From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Subject: [RFC PATCH 1/2] revision: differentiate if --no-abbrev asked explicitly
Date: Sun, 9 Aug 2020 09:19:04 +0700 [thread overview]
Message-ID: <33c02761534f4e0a272f7bc9c7c9ac0218724ace.1596887883.git.congdanhqx@gmail.com> (raw)
In-Reply-To: <cover.1596887883.git.congdanhqx@gmail.com>
When we see `--no-abbrev' in command's arguments, we reset `abbrev' of
`diff_options` to 0, thus, on a later stage, the object id won't
be shortened (by not set object_id[abbrev] to '\0').
While not doing anything is very effective way to show full object id,
we couldn't differentiate if --no-abbrev or not.
In a later change, we want to extend --abbrev support to diff-patch
format.
Let's ask for full object id if we see --no-abbrev instead.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
revision.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/revision.c b/revision.c
index 6de29cdf7a..69cc834662 100644
--- a/revision.c
+++ b/revision.c
@@ -2432,7 +2432,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
} else if (!strcmp(arg, "--always")) {
revs->always_show_header = 1;
} else if (!strcmp(arg, "--no-abbrev")) {
- revs->abbrev = 0;
+ revs->abbrev = hexsz;
} else if (!strcmp(arg, "--abbrev")) {
revs->abbrev = DEFAULT_ABBREV;
} else if (skip_prefix(arg, "--abbrev=", &optarg)) {
--
2.28.0.215.g32ffa52ee0
next prev parent reply other threads:[~2020-08-09 2:19 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-09 2:19 [RFC PATCH 0/2] extend --abbrev support to diff-patch format Đoàn Trần Công Danh
2020-08-09 2:19 ` Đoàn Trần Công Danh [this message]
2020-08-09 2:19 ` [RFC PATCH 2/2] diff: " Đoàn Trần Công Danh
2020-08-09 19:01 ` [RFC PATCH 0/2] " Junio C Hamano
2020-08-10 10:00 ` Jeff King
2020-08-10 12:31 ` Đoàn Trần Công Danh
2020-08-10 15:15 ` Junio C Hamano
2020-08-10 15:27 ` Jeff King
2020-08-11 0:33 ` Đoàn Trần Công Danh
2020-08-11 5:22 ` Jeff King
2020-08-11 12:07 ` Đoàn Trần Công Danh
2020-08-10 15:06 ` Junio C Hamano
2020-08-11 11:49 ` [PATCH v2 0/2] diff: index-line: respect --abbrev in object's name Đoàn Trần Công Danh
2020-08-11 11:49 ` [PATCH v2 1/2] revision: differentiate if --no-abbrev asked explicitly Đoàn Trần Công Danh
2020-08-11 18:54 ` Junio C Hamano
2020-08-11 11:49 ` [PATCH v2 2/2] diff: index-line: respect --abbrev in object's name Đoàn Trần Công Danh
2020-08-14 0:23 ` [PATCH v3 0/2] " Đoàn Trần Công Danh
2020-08-14 0:23 ` [PATCH v3 1/2] revision: differentiate if --no-abbrev asked explicitly Đoàn Trần Công Danh
2020-08-14 0:50 ` Junio C Hamano
2020-08-14 0:59 ` Đoàn Trần Công Danh
2020-08-14 1:06 ` Junio C Hamano
2020-08-14 14:50 ` Đoàn Trần Công Danh
2020-08-19 22:50 ` Junio C Hamano
2020-08-14 0:23 ` [PATCH v3 2/2] diff: index-line: respect --abbrev in object's name Đoàn Trần Công Danh
2020-08-14 15:18 ` SZEDER Gábor
2020-08-14 17:00 ` Junio C Hamano
2020-08-14 18:59 ` Junio C Hamano
2020-08-15 0:21 ` brian m. carlson
2020-08-15 2:27 ` Đoàn Trần Công Danh
2020-08-17 16:17 ` Junio C Hamano
2020-08-20 4:56 ` Junio C Hamano
2020-08-20 12:35 ` [PATCH v4 0/2] " Đoàn Trần Công Danh
2020-08-20 12:35 ` [PATCH v4 1/2] t4013: improve diff-post-processor logic Đoàn Trần Công Danh
2020-08-20 19:49 ` Junio C Hamano
2020-08-21 12:05 ` Đoàn Trần Công Danh
2020-08-21 15:44 ` Junio C Hamano
2020-08-20 12:35 ` [PATCH v4 2/2] diff: index-line: respect --abbrev in object's name Đoàn Trần Công Danh
2020-08-20 19:58 ` Junio C Hamano
2020-08-21 11:51 ` [PATCH v5 0/2] " Đoàn Trần Công Danh
2020-08-21 11:51 ` [PATCH v5 1/2] t4013: improve diff-post-processor logic Đoàn Trần Công Danh
2020-08-21 11:51 ` [PATCH v5 2/2] diff: index-line: respect --abbrev in object's name Đoàn Trần Công Danh
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=33c02761534f4e0a272f7bc9c7c9ac0218724ace.1596887883.git.congdanhqx@gmail.com \
--to=congdanhqx@gmail.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).