[PATCH 3/8] revision: change abbrev_commit_given to abbrev_commit_explicit

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

 



In a future patch, we want to know if `--[no-]abbrev-commit` arguments
have been explicitly provided. Since `rev_info.abbrev_commit_given` is
only used in one place, co-opt it to become
`rev_info.abbrev_commit_explicit`. This information will be used in a
future patch.

With this change, the semantics of the original usage (in
the `--pretty=raw` codepath) aren't altered.

Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
---
 builtin/log.c | 2 +-
 revision.c    | 3 ++-
 revision.h    | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/builtin/log.c b/builtin/log.c
index 89873d2dc2..e4df16be79 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -230,7 +230,7 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
 		 */
 		if (!decoration_given)
 			decoration_style = 0;
-		if (!rev->abbrev_commit_given)
+		if (!rev->abbrev_commit_explicit)
 			rev->abbrev_commit = 0;
 	}
 
diff --git a/revision.c b/revision.c
index 2151b119b7..02b49ab754 100644
--- a/revision.c
+++ b/revision.c
@@ -2271,9 +2271,10 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 			revs->abbrev = hexsz;
 	} else if (!strcmp(arg, "--abbrev-commit")) {
 		revs->abbrev_commit = 1;
-		revs->abbrev_commit_given = 1;
+		revs->abbrev_commit_explicit = 1;
 	} else if (!strcmp(arg, "--no-abbrev-commit")) {
 		revs->abbrev_commit = 0;
+		revs->abbrev_commit_explicit = 1;
 	} else if (!strcmp(arg, "--full-diff")) {
 		revs->diff = 1;
 		revs->full_diff = 1;
diff --git a/revision.h b/revision.h
index addd69410b..7670f29973 100644
--- a/revision.h
+++ b/revision.h
@@ -185,7 +185,7 @@ struct rev_info {
 			show_signature:1,
 			pretty_given:1,
 			abbrev_commit:1,
-			abbrev_commit_given:1,
+			abbrev_commit_explicit:1,
 			zero_commit:1,
 			use_terminator:1,
 			missing_newline:1,
-- 
2.24.0.rc2.262.g2d07a97ef5




[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