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

Re: What is "-u" supposed to mean in git-fetch?

From
Junio C Hamano <junkio@cox.net>
Date
Jan 27, 2006, 03:37 UTC
Message-ID
<7v3bja733p.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7voe1zfbsm.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 8 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>...
>> Also, in the course of researching this, I tried
>>
>> 	git-whatchanged git-fetch-script
>
> As in Linus' message, "git whatchanged -- git-fetch-script" is
> supposed to be the kosher way now, but it does *not* work.
Here is an attempt to fix it.

It is not perfect. As I said in a different message, the option parsing by rev-parse in whatchanged might have outlived its usefulness, especially after rev-list acquired path limit arguments. If you see what 'sh -x git-whatchanged' does, you will notice that the path limiter is not given to rev-list, but is given to diff-tree.

-- >8 -- [PATCH] rev-parse: make "whatchanged -- git-fetch-script" work again.

The latest update to avoid misspelled revs interfered when we were not interested in parsing non flags or arguments not meant for rev-list. This makes these two forms work again:

	git whatchanged -- git-fetch-script

We could enable "!def" in the part this change touches to make the above work without '--', but then it would cause misspelled v2.6.14..v2.6.16 to be given to diff-tree and defeats the whole point of the previous fix.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 rev-parse.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
f63fb6067037890d4928e35f7839f2a133a08d80
diff --git a/rev-parse.c b/rev-parse.c
index 7abad35..9567b0f 100644
--- a/rev-parse.c
+++ b/rev-parse.c
@@ -294,7 +294,9 @@ int main(int argc, char **argv)
 		}
 		if (verify)
 			die("Needed a single revision");
-		if (lstat(arg, &st) < 0)
+		if ((filter & DO_REVS) &&
+		    (filter & DO_NONFLAGS) && /* !def && */
+		    lstat(arg, &st) < 0)
 			die("'%s': %s", arg, strerror(errno));
 		as_is = 1;
 		show_file(arg);
-- 
1.1.4.g2cff
Previous: Junio C Hamano
Message 3 of 3 in “What is "-u" supposed to mean in git-fetch?”
  1. Johannes SchindelinJan 26, 2006
  2. Junio C HamanoJan 26, 2006
  3. Junio C HamanoJan 27, 2006

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.