From: Emily Shaffer <emilyshaffer@google.com>
To: git@vger.kernel.org
Cc: Emily Shaffer <emilyshaffer@google.com>
Subject: [RFC PATCH] rev-list: clarify --abbrev and --abbrev-commit usage
Date: Thu, 13 Jun 2019 15:15:41 -0700 [thread overview]
Message-ID: <20190613221541.10007-1-emilyshaffer@google.com> (raw)
Indicate that --abbrev only works with --abbrev-commit also specified.
It seems that simply running `git rev-list --abbrev=5` doesn't
abbreviate commit OIDs. But the combination of `git rev-list
--abbrev-commit --abbrev=5` works as expected. Clarify in the
documentation by indicating that --abbrev is an optional addition to the
--abbrev-commit option. --no-abbrev remains on a separate line as it can
still be used to disable OID abbreviation even if --abbrev-commit has
been specified.
Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Change-Id: If9b1198938e1a3515ae6740241f7b791fb7a88bd
---
I thought this was odd when I was working on the other rev-list changes
- --abbrev doesn't do anything on its own. It looks like it does work by
itself in other commands, but apparently not in rev-list.
Listed this patch as RFC because maybe instead it's better to fix
something so --abbrev can be used alone, or teach --abbrev-commit=<n>.
It looks like `git log --abbrev=5` also doesn't work the way one might
expect, which makes sense to me, as they use the same internals for
option parsing (parse_revisions()).
The manpages for log and rev-list both correctly indicate that
--abbrev=<n> is an optional addition to --abbrev-commit. `git log -h` is
generated by parse-options tooling and doesn't cover --abbrev-commit at
all, but `git rev-list` doesn't use an option parser on its own and the
usage is hardcoded.
- Emily
builtin/rev-list.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 9f31837d30..6ae0087b01 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -49,8 +49,8 @@ static const char rev_list_usage[] =
" --objects | --objects-edge\n"
" --unpacked\n"
" --header | --pretty\n"
-" --abbrev=<n> | --no-abbrev\n"
-" --abbrev-commit\n"
+" --abbrev-commit [--abbrev=<n>]\n"
+" --no-abbrev\n"
" --left-right\n"
" --count\n"
" special purpose:\n"
--
2.22.0.rc2.383.gf4fbbf30c2-goog
next reply other threads:[~2019-06-13 22:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 22:15 Emily Shaffer [this message]
2019-06-14 16:09 ` [RFC PATCH] rev-list: clarify --abbrev and --abbrev-commit usage Junio C Hamano
2019-06-14 16:18 ` Jeff King
2019-06-14 20:59 ` Emily Shaffer
2019-06-14 21:27 ` Jeff King
2019-06-14 22:56 ` Emily Shaffer
2019-06-19 21:21 ` Jeff King
2019-06-19 22:09 ` Emily Shaffer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190613221541.10007-1-emilyshaffer@google.com \
--to=emilyshaffer@google.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).