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

Re: [PATCH] Restore ls-remote reference pattern matching

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 9, 2007, 03:22 UTC
Message-ID
<7vodd0tuuu.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<Pine.LNX.4.64.0712082134350.5349@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
> How's this? I vaguely tested it, and it doesn't break existing tests, and 
> it matches my guess at how the old code worked, at least maybe.

Well, contrib/examples/git-ls-remote.sh is your friend and you do not have to "guess".

It did, for each ref $path it got from peek-remote, this:
		for pat
		do
			case "/$path" in
			*/$pat )
				match=yes
				break ;;
			esac
		done

I do not think pathspec_match() matches the string in a way compatible with the above loop, and calling get_pathspec(prefix, argv) with anything but a real path is a misuse of the interface.

I think if you do fnmatch(3) that would be compatible with the shell loop.

Previous: Daniel BarkalowNext: Daniel Barkalow
Message 2 of 10 in “Restore ls-remote reference pattern matching”
  1. Restore ls-remote reference pattern matchingDaniel Barkalow, Dec 9, 2007
  2. Junio C HamanoDec 9, 2007
  3. Daniel BarkalowDec 9, 2007
  4. Junio C HamanoDec 9, 2007
  5. Sergey VlasovDec 9, 2007
  6. Eyvind BernhardsenDec 9, 2007
  7. Junio C HamanoDec 9, 2007
  8. Junio C HamanoDec 9, 2007
  9. Eyvind BernhardsenDec 10, 2007
  10. Junio C HamanoDec 10, 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.