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

Re: gitk from subdirectory

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 31, 2007, 05:45 UTC
Message-ID
<7vejhk45q5.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.0.999.0708302200160.25853@woody.linux-foundation.org>

"git log" family of commands, even when run from a subdirectory, do not limit the revision range with the current directory as the path limiter, but with double-dash without any paths after it, i.e. "git log --" do so. It was a mistake to have a difference between "git log --" and "git log" introduced in commit ae563542bf10fa8c33abd2a354e4b28aca4264d7 (First cut at libifying revlist generation).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 revision.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/revision.c b/revision.c
index 51fff0e..c193c3e 100644
--- a/revision.c
+++ b/revision.c
@@ -896,7 +896,8 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
 			continue;
 		argv[i] = NULL;
 		argc = i;
-		revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
+		if (argv[i + 1])
+			revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
 		seen_dashdash = 1;
 		break;
 	}
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 9 in “gitk from subdirectory”
  1. Junio C HamanoAug 31, 2007
  2. Junio C HamanoAug 31, 2007
  3. Linus TorvaldsAug 31, 2007
  4. Junio C HamanoAug 31, 2007
  5. Junio C HamanoAug 31, 2007
  6. Junio C HamanoAug 31, 2007
  7. Junio C HamanoAug 31, 2007
  8. Linus TorvaldsAug 31, 2007
  9. Junio C HamanoAug 31, 2007

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.