Skip to contentSkip to conversation

forbid log --graph --no-walk

PATCH In review epilys 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore

epilys

author
#0 lore raw

PATCH 1/1 forbid log --graph --no-walk

In git-log, --graph shows a graphical representation of a continuous commit history, and --no-walk shows discrete specified commits without continuity. This doesn't make sense, so we forbid the combined use of these flags.

---
 builtin/log.c  | 2 ++
 t/t4202-log.sh | 4 ++++
 2 files changed, 6 insertions(+)
builtin/log.c +0 -0
index dd8f3fc..0194133 100644
@@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char

**argv, const char *prefix,
memset(&w, 0, sizeof(w)); userformat_find_requirements(NULL, &w);
+ if (rev->graph && rev->no_walk)
+ die("--graph and --no-walk are incompatible");
if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
rev->show_notes = 1;
if (rev->show_notes)

t/t4202-log.sh +3 -1
index 5f2b290..4dd939b 100755
@@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph
--show-signature for merged tag' '
 	grep "^| | gpg: Good signature" actual
 '
 +test_expect_success 'forbid log --graph --no-walk' '
+    test_must_fail git log --graph --no-walk
+'
+

test_done

Signature · 1 line
2.1.4
#1 lore raw

Subject is usually prefixed with the part that is changed, in this case log.

For example:

log: forbid log --graph --no-walk

Quoted 16 lines · epilys

In git-log, --graph shows a graphical representation of a continuous commit history, and --no-walk shows discrete specified commits without continuity. This doesn't make sense, so we forbid the combined use of these flags.

---
 builtin/log.c  | 2 ++
 t/t4202-log.sh | 4 ++++
 2 files changed, 6 insertions(+)
builtin/log.c +0 -0
index dd8f3fc..0194133 100644

builtin/log.c static void cmd_log_init_finish(int argc, const char · line 158

Quoted 4 lines
builtin/log.c +0 -0
@@ -155,6 +155,8 @@ static void cmd_log_init_finish(int argc, const char
 **argv, const char *prefix,
 	memset(&w, 0, sizeof(w));
 	userformat_find_requirements(NULL, &w);
 +    if (rev->graph && rev->no_walk)

Patch got corrupted here (Space before +)

t/t4202-log.sh test_expect_success GPG 'log --graph · line 889

Quoted 13 lines
builtin/log.c +1 -0
+        die("--graph and --no-walk are incompatible");
 	if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
 		rev->show_notes = 1;
 	if (rev->show_notes)
t/t4202-log.sh +0 -1
index 5f2b290..4dd939b 100755
@@ -887,4 +887,8 @@ test_expect_success GPG 'log --graph
--show-signature for merged tag' '
 	grep "^| | gpg: Good signature" actual
 '
 +test_expect_success 'forbid log --graph --no-walk' '

Here also

Quoted 4 lines
t/t4202-log.sh +3 -0
+    test_must_fail git log --graph --no-walk
+'
+
 test_done