diff --git a/cmd/ninja/cmd/plugin.go b/cmd/ninja/cmd/plugin.go index 689e9df..240977c 100644 --- a/cmd/ninja/cmd/plugin.go +++ b/cmd/ninja/cmd/plugin.go @@ -303,6 +303,17 @@ func newPluginPublishCmd() *cobra.Command { if len(strings.TrimSpace(string(out))) > 0 { return fmt.Errorf("working tree dirty; commit or pass --allow-dirty") } + } else { + // `git stash create` only captures tracked content, so untracked + // files would be silently dropped from the archive. Warn loudly. + out, _ := exec.Command("git", "ls-files", "--others", "--exclude-standard").Output() + if names := strings.TrimSpace(string(out)); names != "" { + fmt.Fprintln(os.Stderr, "warning: --allow-dirty: these untracked files will NOT be in the archive:") + for _, n := range strings.Split(names, "\n") { + fmt.Fprintln(os.Stderr, " "+n) + } + fmt.Fprintln(os.Stderr, " (run `git add ` if they should be shipped)") + } } out, _ := exec.Command("git", "ls-files", "--cached", "--ignored", "--exclude-standard").Output()