git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3] log: forbid log --graph --no-walk

From
Manos Pitsidianakis <epilys@norn.io>
Date
Mar 15, 2015, 00:43 UTC
Message-ID
<5504D5A2.2070405@norn.io>
In-Reply-To
<md5:DbynqDqKsm8mpedJ3B12rw==>

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.

Signed-off-by: Manos Pitsidianakis <epilys@norn.io>
---
This is a microproject intended to complement my GSoC application.
 builtin/log.c  | 2 ++
 t/t4202-log.sh | 4 ++++
 2 files changed, 6 insertions(+)
diff --git a/builtin/log.c b/builtin/log.c
index dd8f3fc..5aaf964 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -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)
diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 5f2b290..5d72713 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -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
-- 
2.1.4
Next: Dongcan Jiang
Message 1 of 7 in “log: forbid log --graph --no-walk”
  1. log: forbid log --graph --no-walkManos Pitsidianakis, Mar 15, 2015
  2. Dongcan JiangMar 15, 2015
  3. Manos PitsidianakisMar 15, 2015
  4. Dongcan JiangMar 15, 2015
  5. Manos PitsidianakisMar 16, 2015
  6. Junio C HamanoMar 16, 2015
  7. Manos PitsidianakisMar 16, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.