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

Re: [PATCH] get_sha1: support relative path "<obj>:<sth>" syntax

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 10, 2010, 17:47 UTC
Message-ID
<20101110174736.GD11513@burratino>
In-Reply-To
<1289407021-30287-1-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy wrote:
> This does not work in commands that startup_info is NULL
> (i.e. non-builtin ones).
That is easily fixable, no?
The non-builtins are:
	fast-import
	imap-send
	shell
	daemon
	show-index
	upload-pack
	http-backend
	http-fetch
	http-push

Of those, only fast-import might have a possible reason need to know about this new syntax.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 Assuming your patch builds on acf4823a (setup: save prefix (original
 cwd relative to toplevel) in startup_info, 2010-10-24).
 Untested.
diff --git a/fast-import.c b/fast-import.c
index 77549eb..3b597e8 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -2923,8 +2923,11 @@ static void parse_argv(void)
 
 int main(int argc, const char **argv)
 {
+	static struct startup_info git_startup_info;
 	unsigned int i;
 
+	startup_info = &git_startup_info;
+
 	git_extract_argv0_path(argv[0]);
 
 	if (argc == 2 && !strcmp(argv[1], "-h"))
Previous: Matthieu MoyNext: Nguyen Thai Ngoc Duy
Message 12 of 21 in “Re: [RFC] Using gitrevisions :/search style with other operators”
  1. Yann DirsonNov 9, 2010
  2. Kevin BallardNov 9, 2010
  3. Yann DirsonNov 9, 2010
  4. Junio C HamanoNov 10, 2010
  5. Kevin BallardNov 10, 2010
  6. Yann DirsonNov 10, 2010
  7. Kevin BallardNov 10, 2010
  8. Yann DirsonNov 10, 2010
  9. Jakub NarebskiNov 10, 2010
  10. get_sha1: support relative path "<obj>:<sth>" syntaxNguyễn Thái Ngọc Duy, Nov 10, 2010
  11. Matthieu MoyNov 10, 2010
  12. Jonathan NiederNov 10, 2010
  13. Nguyen Thai Ngoc DuyNov 11, 2010
  14. Junio C HamanoNov 10, 2010
  15. Nguyen Thai Ngoc DuyNov 11, 2010
  16. Junio C HamanoDec 9, 2010
  17. Junio C HamanoDec 9, 2010
  18. Nguyen Thai Ngoc DuyDec 10, 2010
  19. Junio C HamanoNov 10, 2010
  20. Jakub NarebskiNov 10, 2010
  21. Jeff KingNov 9, 2010

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.