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

Re: Current status toward 0.99.5 and beyond

From
Linus Torvalds <torvalds@osdl.org>
Date
Aug 23, 2005, 17:31 UTC
Message-ID
<Pine.LNX.4.58.0508231022340.3317@g5.osdl.org>
In-Reply-To
<7vmzn8poc8.fsf@assigned-by-dhcp.cox.net>
On Tue, 23 Aug 2005, Junio C Hamano wrote:
Show 9 quoted lines
>
> So far, the following commands should be usable with relative directory
> paths:
> 
>     update-cache
>     ls-files
>     diff-files
>     diff-cache
>     diff-tree
Also, git-rev-parse.

Finally, this trivial patch makes "git-rev-list" also able to handle not being in the top-level directory, which makes it possible to do "git log" and "git-whatchanged" at any point in the directory structure.

			Linus
---
Subject: Make "git-rev-list" work within subdirectories

This trivial patch makes ""git-rev-list" able to handle not being in the top-level directory. This magically also makes "git-whatchanged" do the right thing.

Trivial scripting fix to make sure that "git log" also works.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
---
diff --git a/git-log-script b/git-log-script
--- a/git-log-script
+++ b/git-log-script
@@ -1,5 +1,4 @@
 #!/bin/sh
-. git-sh-setup-script || die "Not a git archive"
-revs=$(git-rev-parse --revs-only --default HEAD "$@")
+revs=$(git-rev-parse --revs-only --default HEAD "$@") || exit
 [ "$revs" ] || die "No HEAD ref"
 git-rev-list --pretty $(git-rev-parse --default HEAD "$@") | LESS=-S ${PAGER:-less}
diff --git a/rev-list.c b/rev-list.c
--- a/rev-list.c
+++ b/rev-list.c
@@ -481,6 +481,7 @@ static void handle_one_commit(struct com
 int main(int argc, char **argv)
 {
 	struct commit_list *list = NULL;
+	const char *prefix = setup_git_directory();
 	int i, limited = 0;
 
 	for (i = 1 ; i < argc; i++) {
Previous: Junio C Hamano
Message 2 of 2 in “Current status toward 0.99.5 and beyond”
  1. Junio C HamanoAug 23, 2005
  2. Linus TorvaldsAug 23, 2005

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.