{"thread":{"id":"35708","subject":"[PATCH] Add cross-references between docs for for-each-ref and show-ref","startedAt":"2014-01-22T11:23:20Z","lastAt":"2014-01-22T15:58:46Z","messageCount":2,"participants":["Michael Haggerty","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"233506","messageId":"1390389800-26769-1-git-send-email-mhagger@alum.mit.edu","threadId":"35708","inReplyTo":null,"subject":"[PATCH] Add cross-references between docs for for-each-ref and show-ref","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2014-01-22T11:23:20Z","receivedAt":"2014-01-22T11:23:20Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"Add cross-references between the manpages for git-for-each-ref(1) and\ngit-show-ref(1).\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\nThere is a lot of overlap between the functionality of these two\ncommands.  It might be handy to give the user some hints about when to\nuse one command vs. the other, but honestly I don't have a gut feeling\nfor this myself.  Maybe long-term the commands should converge into\none?\n\n Documentation/git-for-each-ref.txt | 4 ++++\n Documentation/git-show-ref.txt     | 1 +\n 2 files changed, 5 insertions(+)\n\ndiff --git a/Documentation/git-for-each-ref.txt b/Documentation/git-for-each-ref.txt\nindex 94f5c46..d639abe 100644\n--- a/Documentation/git-for-each-ref.txt\n+++ b/Documentation/git-for-each-ref.txt\n@@ -227,6 +227,10 @@ Documentation\n -------------\n Documentation by Junio C Hamano and the git-list <git@vger.kernel.org>.\n \n+SEE ALSO\n+--------\n+linkgit:git-show-ref[1]\n+\n GIT\n ---\n Part of the linkgit:git[1] suite\ndiff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt\nindex b0a309b..ffd1b03 100644\n--- a/Documentation/git-show-ref.txt\n+++ b/Documentation/git-show-ref.txt\n@@ -175,6 +175,7 @@ FILES\n \n SEE ALSO\n --------\n+linkgit:git-for-each-ref[1],\n linkgit:git-ls-remote[1],\n linkgit:git-update-ref[1],\n linkgit:gitrepository-layout[5]\n-- \n1.8.5.2\n"},{"id":"233519","messageId":"xmqqbnz4ypmx.fsf@gitster.dls.corp.google.com","threadId":"35708","inReplyTo":"1390389800-26769-1-git-send-email-mhagger@alum.mit.edu","subject":"Re: [PATCH] Add cross-references between docs for for-each-ref and show-ref","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-01-22T15:58:46Z","receivedAt":"2014-01-22T15:58:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Haggerty <mhagger@alum.mit.edu> writes:\n\n> Add cross-references between the manpages for git-for-each-ref(1) and\n> git-show-ref(1).\n>\n> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n> ---\n> There is a lot of overlap between the functionality of these two\n> commands.\n\nTwo differences I most often use (i.e. take advantage of) are:\n\n - The former is about showing 0 or more matching refs, and not\n   matching anything is a perfectly normal condition, i.e.\n\n   $ git for-each-ref refs/heads/no-such\n\n   exits with status 0.  The latter can be used with --verify to\n   check if one ref exists, on the other hand.\n\n - The former takes the match-from-left-to-right pattern (similar to\n   the usual pathspec match), while the latter matches from the\n   tail.\n\n   $ git for-each-ref refs/heads/*  ;# only one-level names\n   $ git for-each-ref refs/heads/** ;# catches both master and mh/path-max\n   $ git show-ref master ;# refs/heads/master, refs/remotes/origin/master,...\n"}]}