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

[PATCH] Re: Make 'git show' more useful

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jul 13, 2009, 23:43 UTC
Message-ID
<1247528614-24590-1-git-send-email-bonzini@gnu.org>
In-Reply-To
<7vtz1gi67v.fsf@alter.siamese.dyndns.org>
Show 6 quoted lines
> And, admittedly, you can _already_ do this by just adding "--do-walk"
> whenever you specify a range. And equally admittedly, you can already
> confuse git by adding the "--no-walk" _after_ specifying the range,
> ie you can do this:
>
> 	git log HEAD~5.. --no-walk
Even without the change you could do
	git show --do-walk HEAD~5.. --no-walk

But then why do we want --do-walk and --no-walk? You can always use "git rev-parse" instead of "git rev-list --no-walk" (just check that the output is a single SHA1 id), and I don't think it is so important to be able to say "git log --no-walk" instead of "git log -1".

They are not tested either. Just gitk cares about --no-walk... to prevent the user from giving it.

So, what about squashing this with Linus's patch? (This is meant to be squashed, which is why this text is not in a cover letter). Still:

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
---
 Documentation/git-rev-list.txt     |    1 -
 Documentation/rev-list-options.txt |    8 --------
 revision.c                         |   13 ++-----------
 gitk-git/gitk                      |    1 -+
 3 files changed, 3 insertions(+), 21 deletions(-)
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 1c9cc28..b02cf54 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -44,7 +44,6 @@ SYNOPSIS
 	     [ \--merge ]
 	     [ \--reverse ]
 	     [ \--walk-reflogs ]
-	     [ \--no-walk ] [ \--do-walk ]
 	     <commit>... [ \-- <paths>... ]
 
 DESCRIPTION
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 11eec94..d137e32 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -624,11 +624,3 @@ These options are mostly targeted for packing of git repositories.
 
 	Only useful with '--objects'; print the object IDs that are not
 	in packs.
-
---no-walk::
-
-	Only show the given revs, but do not traverse their ancestors.
-
---do-walk::
-
-	Overrides a previous --no-walk.
diff --git a/revision.c b/revision.c
index a31434b..8b1a385 100644
--- a/revision.c
+++ b/revision.c
@@ -993,8 +993,7 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
 	/* pseudo revision arguments */
 	if (!strcmp(arg, "--all") || !strcmp(arg, "--branches") ||
 	    !strcmp(arg, "--tags") || !strcmp(arg, "--remotes") ||
-	    !strcmp(arg, "--reflog") || !strcmp(arg, "--not") ||
-	    !strcmp(arg, "--no-walk") || !strcmp(arg, "--do-walk"))
+	    !strcmp(arg, "--reflog") || !strcmp(arg, "--not"))
 	{
 		unkv[(*unkc)++] = arg;
 		return 1;
@@ -1273,14 +1272,6 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 				flags ^= UNINTERESTING;
 				continue;
 			}
-			if (!strcmp(arg, "--no-walk")) {
-				revs->no_walk = 1;
-				continue;
-			}
-			if (!strcmp(arg, "--do-walk")) {
-				revs->no_walk = 0;
-				continue;
-			}
 
 			opts = handle_revision_opt(revs, argc - i, argv + i, &left, argv);
 			if (opts > 0) {
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 4604c83..984d30a 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -169,7 +169,7 @@ proc parseviewargs {n arglist} {
 	    "--name-only" - "--name-status" - "--color" - "--color-words" -
 	    "--log-size" - "--pretty=*" - "--decorate" - "--abbrev-commit" -
 	    "--cc" - "-z" - "--header" - "--parents" - "--boundary" -
-	    "--no-color" - "-g" - "--walk-reflogs" - "--no-walk" -
+	    "--no-color" - "-g" - "--walk-reflogs" -
 	    "--timestamp" - "relative-date" - "--date=*" - "--stdin" -
 	    "--objects" - "--objects-edge" - "--reverse" {
 		# These cause our parsing of git log's output to fail, or else
-- 
1.6.2.5
Previous: Junio C HamanoNext: Linus Torvalds
Message 3 of 17 in “Make 'git show' more useful”
  1. Linus TorvaldsJul 13, 2009
  2. Junio C HamanoJul 13, 2009
  3. Re: Make 'git show' more usefulPaolo Bonzini, Jul 13, 2009
  4. Linus TorvaldsJul 14, 2009
  5. Johannes SchindelinJul 14, 2009
  6. Linus TorvaldsJul 14, 2009
  7. Paolo BonziniJul 14, 2009
  8. Johannes SchindelinJul 14, 2009
  9. t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 14, 2009
  10. Johannes SixtJul 14, 2009
  11. Michael J GruberJul 14, 2009
  12. [PATCHv2] t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 14, 2009
  13. Johannes SchindelinJul 14, 2009
  14. Michael J GruberJul 14, 2009
  15. t4202-log.sh: Test git log --no-walk sort orderMichael J Gruber, Jul 17, 2009
  16. Johannes SchindelinJul 17, 2009
  17. Johannes SchindelinJul 13, 2009

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.