1
0
mirror of https://github.com/git/git.git synced 2024-10-22 11:18:17 +02:00
git/Documentation
Stefan Beller dd6962dd73 short status: improve reporting for submodule changes
If I add an untracked file to a submodule or modify a tracked file,
currently "git status --short" treats the change in the same way as
changes to the current HEAD of the submodule:

        $ git clone --quiet --recurse-submodules https://gerrit.googlesource.com/gerrit
        $ echo hello >gerrit/plugins/replication/stray-file
        $ sed -i -e 's/.*//' gerrit/plugins/replication/.mailmap
        $ git -C gerrit status --short
         M plugins/replication

This is by analogy with ordinary files, where "M" represents a change
that has not been added yet to the index.  But this change cannot be
added to the index without entering the submodule, "git add"-ing it,
and running "git commit", so the analogy is counterproductive.

Introduce new status letters " ?" and " m" for this.  These are similar
to the existing "??" and " M" but mean that the submodule (not the
parent project) has new untracked files and modified files, respectively.
The user can use "git add" and "git commit" from within the submodule to
add them.

Changes to the submodule's HEAD commit can be recorded in the index with
a plain "git add -u" and are shown with " M", like today.

To avoid excessive clutter, show at most one of " ?", " m", and " M" for
the submodule.  They represent increasing levels of change --- the last
one that applies is shown (e.g., " m" if there are both modified files
and untracked files in the submodule, or " M" if the submodule's HEAD
has been modified and it has untracked files).

While making these changes, we need to make sure to not break porcelain
level 1, which shares code with "status --short".  We only change
"git status --short".

Non-short "git status" and "git status --porcelain=2" already handle
these cases by showing more detail:

        $ git -C gerrit status --porcelain=2
        1 .M S.MU 160000 160000 160000 305c864db28eb0c77c8499bc04c87de3f849cf3c 305c864db28eb0c77c8499bc04c87de3f849cf3c plugins/replication
        $ git -C gerrit status
[...]
        modified:   plugins/replication (modified content, untracked content)

Scripts caring about these distinctions should use --porcelain=2.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-29 15:27:54 -07:00
..
howto Merge branch 'po/fix-doc-merge-base-illustration' into maint 2016-10-28 09:01:21 -07:00
RelNotes Sync with maint 2017-03-21 15:11:38 -07:00
technical Merge branch 'bw/attr' 2017-02-27 13:57:14 -08:00
.gitattributes
.gitignore
asciidoc.conf
asciidoctor-extensions.rb Documentation: implement linkgit macro for Asciidoctor 2017-01-31 12:18:18 -08:00
blame-options.txt Merge branch 'bc/blame-doc-fix' 2017-02-24 10:48:08 -08:00
build-docdep.perl
cat-texi.perl Documentation: remove unneeded argument in cat-texi.perl 2017-01-23 10:56:47 -08:00
cmd-list.perl command-list: prepare machinery for upcoming "common groups" section 2015-05-21 13:03:37 -07:00
CodingGuidelines CodingGuidelines: clarify multi-line brace style 2017-01-17 14:32:47 -08:00
config.txt Merge branch 'ab/push-default-doc-fix' 2017-03-21 15:07:19 -07:00
date-formats.txt Merge branch 'lr/doc-fix-cet' into maint 2017-01-17 15:19:08 -08:00
diff-config.txt Merge branch 'rh/diff-orderfile-doc' 2017-01-23 15:59:23 -08:00
diff-format.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
diff-generate-patch.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
diff-heuristic-options.txt diff: retire "compaction" heuristics 2016-12-23 12:32:22 -08:00
diff-options.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
docbook-xsl.css
docbook.xsl
everyday.txto Documentation: fix linkgit references 2016-05-09 15:44:14 -07:00
fetch-options.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
fix-texi.perl
fmt-merge-msg-config.txt Documentation: include 'merge.branchdesc' for merge and config as well 2015-05-28 12:38:46 -07:00
git-add.txt add: document the chmod option 2016-09-12 15:03:32 -07:00
git-am.txt Merge branch 'mm/doc-tt' 2016-07-13 11:24:14 -07:00
git-annotate.txt blame: honor the diff heuristic options and config 2016-09-19 10:25:11 -07:00
git-apply.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
git-archimport.txt
git-archive.txt docs: clarify remote restrictions for git-upload-archive 2014-02-28 09:55:35 -08:00
git-bisect-lk2009.txt doc: more consistency in environment variables format 2016-06-08 12:04:37 -07:00
git-bisect.txt Merge branch 'ad/bisect-terms' into maint 2017-01-31 13:32:10 -08:00
git-blame.txt Merge branch 'jc/blame-reverse' 2016-10-10 14:03:51 -07:00
git-branch.txt Merge branch 'kn/ref-filter-branch-list' 2017-02-27 13:57:13 -08:00
git-bundle.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
git-cat-file.txt cat-file: support --textconv/--filters in batch mode 2016-09-11 14:48:15 -07:00
git-check-attr.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-check-ignore.txt Documentation: fix linkgit references 2016-05-09 15:44:14 -07:00
git-check-mailmap.txt
git-check-ref-format.txt git-check-ref-format: clarify documentation for --normalize 2017-02-21 13:02:42 -08:00
git-checkout-index.txt
git-checkout.txt checkout.txt: document a common case that ignores ambiguation rules 2016-09-21 08:44:41 -07:00
git-cherry-pick.txt Merge branch 'mm/doc-tt' into maint 2016-07-28 11:25:54 -07:00
git-cherry.txt
git-citool.txt
git-clean.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-clone.txt Merge branch 'nd/shallow-deepen' 2016-10-10 14:03:50 -07:00
git-column.txt
git-commit-tree.txt Merge branch 'mm/doc-tt' into maint 2016-07-28 11:25:54 -07:00
git-commit.txt Merge branch 'nd/commit-hook-doc-fix' 2017-03-21 15:07:20 -07:00
git-config.txt Merge branch 'dg/document-git-c-in-git-config-doc' into maint 2016-09-08 21:35:56 -07:00
git-count-objects.txt count-objects: report alternates via verbose mode 2016-10-10 13:52:37 -07:00
git-credential-cache--daemon.txt credential-cache: close stderr in daemon process 2014-09-16 11:11:58 -07:00
git-credential-cache.txt credential-cache--daemon: disallow relative socket path 2016-02-23 12:56:27 -08:00
git-credential-store.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-credential.txt
git-cvsexportcommit.txt
git-cvsimport.txt Merge branch 'jk/doc-cvs-update' into maint 2016-10-03 13:22:25 -07:00
git-cvsserver.txt doc: typeset HEAD and variants as literal 2016-06-28 08:36:45 -07:00
git-daemon.txt doc: typeset HEAD and variants as literal 2016-06-28 08:36:45 -07:00
git-describe.txt describe: teach describe negative pattern matches 2017-01-23 18:33:17 -08:00
git-diff-files.txt
git-diff-index.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-diff-tree.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-diff.txt Documentation: fix misuses of "nor" 2014-03-31 15:16:22 -07:00
git-difftool.txt Document the --no-gui option in difftool 2017-02-08 13:30:28 -08:00
git-fast-export.txt doc: convert \--option to --option 2015-05-12 22:14:46 -07:00
git-fast-import.txt Merge branch 'mm/doc-tt' 2016-07-13 11:24:14 -07:00
git-fetch-pack.txt upload-pack: optionally allow fetching any sha1 2016-11-18 13:06:14 -08:00
git-fetch.txt Merge branch 'mm/push-social-engineering-attack-doc' into maint 2017-01-17 15:19:10 -08:00
git-filter-branch.txt filter-branch: fix --prune-empty on parentless commits 2017-03-03 12:43:37 -08:00
git-fmt-merge-msg.txt Documentation/fmt-merge-msg: fix markup in example 2016-10-28 05:51:51 -07:00
git-for-each-ref.txt ref-filter: resurrect "strip" as a synonym to "lstrip" 2017-02-07 11:50:34 -08:00
git-format-patch.txt doc: change erroneous --[no]-whatever into --[no-]whatever 2017-03-20 10:04:57 -07:00
git-fsck-objects.txt
git-fsck.txt fsck: optionally show more helpful info for broken links 2016-07-18 15:15:59 -07:00
git-gc.txt docs/git-gc: fix default value for --aggressiveDepth 2017-02-24 09:59:12 -08:00
git-get-tar-commit-id.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-grep.txt grep: enable recurse-submodules to work on <tree> objects 2016-12-22 11:47:33 -08:00
git-gui.txt doc: git-gui browser does not default to HEAD 2017-01-13 12:23:28 -08:00
git-hash-object.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-help.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-http-backend.txt doc: more consistency in environment variables format 2016-06-08 12:04:37 -07:00
git-http-fetch.txt
git-http-push.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-imap-send.txt imap-send: use cURL automatically when NO_OPENSSL defined 2015-03-10 15:19:05 -07:00
git-index-pack.txt index-pack: add --max-input-size=<size> option 2016-08-24 12:31:05 -07:00
git-init-db.txt
git-init.txt init: document dotfiles exclusion on template copy 2017-02-17 15:57:21 -08:00
git-instaweb.txt doc: change configuration variables format 2016-06-08 12:04:55 -07:00
git-interpret-trailers.txt doc: mention user-configured trailers 2016-11-21 12:49:57 -08:00
git-log.txt Merge branch 'mj/log-show-signature-conf' 2016-07-11 10:31:08 -07:00
git-ls-files.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
git-ls-remote.txt ls-remote: add support for showing symrefs 2016-01-19 10:07:56 -08:00
git-ls-tree.txt Documentation: improve description for core.quotePath 2017-03-02 11:40:51 -08:00
git-mailinfo.txt Merge branch 'va/mailinfo-doc-typofix' into maint 2016-05-26 13:17:14 -07:00
git-mailsplit.txt mailsplit: support unescaping mboxrd messages 2016-06-06 11:14:43 -07:00
git-merge-base.txt doc: fix merge-base ASCII art tab spacing 2016-10-21 09:46:48 -07:00
git-merge-file.txt merge-file: clamp exit code to maximum 127 2015-10-29 12:10:23 -07:00
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt merge: add '--continue' option as a synonym for 'git commit' 2016-12-14 10:02:04 -08:00
git-mergetool--lib.txt
git-mergetool.txt mergetool: honor -O<orderfile> 2016-10-11 10:04:31 -07:00
git-mktag.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-mktree.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-mv.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-name-rev.txt name-rev: add support to exclude refs by pattern match 2017-01-23 18:33:17 -08:00
git-notes.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-p4.txt Merge branch 'ls/p4-retry-thrice' 2017-01-18 15:12:12 -08:00
git-pack-objects.txt document git-repack interaction of pack.threads and pack.windowMemory 2016-08-10 10:55:13 -07:00
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-prune-packed.txt Documentation: adjust document title underlining 2014-10-13 13:35:18 -07:00
git-prune.txt worktree: new place for "git prune --worktrees" 2015-06-29 08:48:44 -07:00
git-pull.txt Merge branch 'mm/push-social-engineering-attack-doc' into maint 2017-01-17 15:19:10 -08:00
git-push.txt Merge branch 'bw/push-submodule-only' 2017-02-10 12:52:23 -08:00
git-quiltimport.txt doc: more consistency in environment variables format 2016-06-08 12:04:37 -07:00
git-read-tree.txt Documentation: use "command-line" when used as a compound adjective, and fix other minor grammatical issues 2014-05-21 13:57:10 -07:00
git-rebase.txt Merge branch 'nd/rebase-forget' 2016-12-19 14:45:35 -08:00
git-receive-pack.txt receive-pack: allow a maximum input size to be specified 2016-08-24 12:31:05 -07:00
git-reflog.txt git-reflog: add exists command 2015-07-21 14:08:14 -07:00
git-remote-ext.txt doc: add some crossrefs between manual pages 2014-11-11 14:47:04 -08:00
git-remote-fd.txt Spelling fixes 2016-08-11 14:35:42 -07:00
git-remote-helpers.txto
git-remote-testgit.txt
git-remote.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-repack.txt Merge branch 'ms/document-pack-window-memory-is-per-thread' 2016-08-12 09:47:35 -07:00
git-replace.txt doc: change environment variables format 2016-06-08 12:04:37 -07:00
git-request-pull.txt doc: show usage of branch description 2015-09-14 12:50:33 -07:00
git-rerere.txt *config.txt: stick to camelCase naming convention 2015-03-13 22:13:46 -07:00
git-reset.txt reset: add an example of how to split a commit into two 2017-02-16 13:38:02 -08:00
git-rev-list.txt Merge branch 'jk/date-local' 2015-10-05 12:30:13 -07:00
git-rev-parse.txt rev-parse: add --show-superproject-working-tree 2017-03-08 15:52:03 -08:00
git-revert.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-rm.txt
git-send-email.txt doc: change erroneous --[no]-whatever into --[no-]whatever 2017-03-20 10:04:57 -07:00
git-send-pack.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt doc: more consistency in environment variables format 2016-06-08 12:04:37 -07:00
git-shell.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-shortlog.txt shortlog: test and document --committer option 2016-12-16 09:39:10 -08:00
git-show-branch.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-show-index.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-show-ref.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-show.txt doc: convert \--option to --option 2015-05-12 22:14:46 -07:00
git-stage.txt Documentation: adjust document title underlining 2014-10-13 13:35:18 -07:00
git-stash.txt stash: allow pathspecs in the no verb form 2017-02-28 14:21:10 -08:00
git-status.txt short status: improve reporting for submodule changes 2017-03-29 15:27:54 -07:00
git-stripspace.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-submodule.txt submodule init: warn about falling back to a local path 2017-02-28 13:46:22 -08:00
git-svn.txt git-svn: document useLogAuthor and addAuthorFrom config keys 2016-12-12 10:49:50 -08:00
git-symbolic-ref.txt
git-tag.txt Merge branch 'cw/log-updates-for-all-refs-really' 2017-02-03 11:25:19 -08:00
git-tools.txt Documentation/git-tools: retire manually-maintained list 2015-07-28 13:21:59 -07:00
git-unpack-file.txt
git-unpack-objects.txt unpack-objects: add --max-input-size=<size> option 2016-08-24 12:31:05 -07:00
git-update-index.txt Documentation/git-update-index: explain splitIndex.* 2017-03-06 12:09:28 -08:00
git-update-ref.txt update-ref and tag: add --create-reflog arg 2015-07-21 14:08:35 -07:00
git-update-server-info.txt
git-upload-archive.txt Documentation: match underline with the text 2015-10-22 10:16:12 -07:00
git-upload-pack.txt upload-pack.c: use parse-options API 2016-05-31 10:17:20 -07:00
git-var.txt
git-verify-commit.txt Merge branch 'dn/gpg-doc' into maint 2016-07-06 13:06:36 -07:00
git-verify-pack.txt git-verify-pack.txt: fix inconsistent spelling of "packfile" 2015-05-17 11:24:57 -07:00
git-verify-tag.txt builtin/verify-tag: add --format to verify-tag 2017-01-17 16:10:22 -08:00
git-web--browse.txt doc: typeset long command-line options as literal 2016-06-28 08:36:45 -07:00
git-whatchanged.txt
git-worktree.txt Merge branch 'bc/worktree-doc-fix-detached' 2017-02-24 10:48:10 -08:00
git-write-tree.txt
git.txt Git 2.12.1 2017-03-20 13:56:13 -07:00
gitattributes.txt Documentation: fix a typo 2017-02-01 13:46:52 -08:00
gitcli.txt Documentation: use "command-line" when used as a compound adjective, and fix other minor grammatical issues 2014-05-21 13:57:10 -07:00
gitcore-tutorial.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitcredentials.txt credential: let empty credential specs reset helper list 2016-02-26 10:58:14 -08:00
gitcvs-migration.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitdiffcore.txt docs/diffcore: unquote "Complete Rewrites" in headers 2017-02-28 11:34:38 -08:00
giteveryday.txt giteveryday: unbreak rendering with AsciiDoctor 2017-01-07 14:03:40 -08:00
gitglossary.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
githooks.txt push options: {pre,post}-receive hook learns about push options 2016-07-14 15:50:17 -07:00
gitignore.txt doc: change configuration variables format 2016-06-08 12:04:55 -07:00
gitk.txt Merge branch 'sb/remove-gitview' 2017-01-18 15:12:18 -08:00
gitmodules.txt Merge branch 'bw/submodule-branch-dot-doc' into maint 2016-10-28 09:01:19 -07:00
gitnamespaces.txt doc: mention transfer data leaks in more places 2016-11-14 11:23:07 -08:00
gitremote-helpers.txt Merge branch 'jk/doc-remote-helpers-markup-fix' 2017-02-15 14:56:40 -08:00
gitrepository-layout.txt Merge branch 'sb/doc-unify-bottom' 2017-02-15 12:54:20 -08:00
gitrevisions.txt doc: gitrevisions - clarify 'latter case' is revision walk 2016-08-13 19:36:44 -07:00
gittutorial-2.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
gittutorial.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
gitweb.conf.txt gitweb: use highlight's shebang detection 2016-09-25 16:39:11 -07:00
gitweb.txt doc: change environment variables format 2016-06-08 12:04:37 -07:00
gitworkflows.txt Documentation: unify bottom "part of git suite" lines 2017-02-09 15:14:01 -08:00
glossary-content.txt pathspec: allow querying for attributes 2017-03-13 15:28:54 -07:00
howto-index.sh howto-index.sh: use the $( ... ) construct for command substitution 2014-04-17 11:14:57 -07:00
i18n.txt Documentation/i18n.txt: clarify character encoding support 2015-07-01 14:55:53 -07:00
install-doc-quick.sh
install-webdoc.sh install-webdoc.sh: use the $( ... ) construct for command substitution 2014-04-17 11:14:58 -07:00
line-range-format.txt Documentation: change -L:<regex> to -L:<funcname> 2015-04-20 11:05:50 -07:00
lint-gitlink.perl ci: validate "linkgit:" in documentation 2016-05-10 11:15:04 -07:00
mailmap.txt
Makefile Merge branch 'bc/use-asciidoctor-opt' 2017-02-02 13:36:57 -08:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt doc: change environment variables format 2016-06-08 12:04:37 -07:00
merge-options.txt Merge branch 'kf/gpg-sig-verification-doc' 2016-05-17 14:38:39 -07:00
merge-strategies.txt merge-strategies.txt: fix typo 2016-02-22 10:42:52 -08:00
pretty-formats.txt pretty: add %(trailers) format for displaying trailers of a commit message 2016-12-11 13:58:41 -08:00
pretty-options.txt Merge branch 'tr/doc-tt' into maint 2016-07-06 13:06:34 -07:00
pull-fetch-param.txt docs: Explain the purpose of fetch's and pull's <refspec> parameter. 2014-06-12 09:59:13 -07:00
rev-list-options.txt rev-list-options.txt: update --all about HEAD 2017-02-08 13:37:32 -08:00
revisions.txt revision: new rev^-n shorthand for rev^n..rev 2016-09-27 10:59:28 -07:00
sequencer.txt
SubmittingPatches doc: clarify distinction between sign-off and pgp-signing 2017-01-27 13:41:30 -08:00
texi.xsl Documentation: add XSLT to fix DocBook for Texinfo 2017-01-23 10:56:53 -08:00
transfer-data-leaks.txt doc: mention transfer data leaks in more places 2016-11-14 11:23:07 -08:00
urls-remotes.txt Documentation: match underline with the text 2015-10-22 10:16:12 -07:00
urls.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
user-manual.conf
user-manual.txt asciidoctor: fix user-manual to be built by asciidoctor 2017-01-13 10:30:16 -08:00