Skip to contentSkip to conversation

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

PATCH In review brian m. carlson 2 participants 4 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): md5:Tyvg1g0l6oUcTR3FnSDstw==

#1 lore raw

PATCH v2 1/1 log: 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. Using both 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 +2 -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 +4 -0
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
#2 lore raw

builtin/log.c static void cmd_log_init_finish(int argc, const char **argv, const char *prefix, · line 159

Quoted 10 lines · epilys
builtin/log.c +2 -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");

It looks like you indented here with four spaces instead of a tab. We prefer tabs in Git.

t/t4202-log.sh test_expect_success GPG 'log --graph --show-signature for merged tag' ' · line 891

Quoted 13 lines
builtin/log.c +0 -0
 	if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
 		rev->show_notes = 1;
 	if (rev->show_notes)
t/t4202-log.sh +2 -0
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

And here as well.

Signature · 3 lines
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
#3 lore raw
Quoted 2 lines · brian m. carlson

It looks like you indented here with four spaces instead of a tab. We prefer tabs in Git.

Messed that up. Do you think I should resubmit a v3 or am I hogging the mailing list too much?

#4 lore raw
Quoted 6 lines · epilys
Quoted 2 lines · brian m. carlson

It looks like you indented here with four spaces instead of a tab. We prefer tabs in Git.

Messed that up. Do you think I should resubmit a v3 or am I hogging the mailing list too much?

You're going to want to submit a v3. While you're at it, you probably want to drop the [GSoC] from the patch header, as it will be part of the commit message when applied, and we don't want that. Finally, you probably want to use your full name in the From: line, as that will be used to create the commit, and we prefer full names over aliases as well.

It can be helpful to try formatting the patch with git format-patch and then checking over it with less and applying it with git am to see how it will look to other Git developers.

This is a small patch, so it's not as big a deal, but for larger series I generally try to wait two or three days (at least one of which is a weekday) before posting a new version so that people have time to read, test, and comment on it.

Signature · 3 lines
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187