[RFC PATCH 1/2] revision: differentiate if --no-abbrev asked explicitly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux