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

Re: [PATCH 1/2] Change "refs/" references to symbolic constants

From
Jeff King <peff@peff.net>
Date
Oct 2, 2007, 01:16 UTC
Message-ID
<20071002011659.GA7938@coredump.intra.peff.net>
In-Reply-To
<200710012141.44459.andyparkins@gmail.com>
On Mon, Oct 01, 2007 at 09:41:43PM +0100, Andy Parkins wrote:
Show 17 quoted lines
> Please hold off on applying this.  I'm getting this when running the tests:
> 
> *** t5516-fetch-push.sh ***
> *   ok 1: setup
> *   ok 2: fetch without wildcard
> *   ok 3: fetch with wildcard
> *   ok 4: push without wildcard
> *   ok 5: push with wildcard
> *   ok 6: push with matching heads
> *   ok 7: push with no ambiguity (1)
> *   ok 8: push with no ambiguity (2)
> *   ok 9: push with weak ambiguity (1)
> *   ok 10: push with weak ambiguity (2)
> *   ok 11: push with ambiguity (1)
> * FAIL 12: push with ambiguity (2)
> 
> I'm having trouble seeing where the fault is at the moment though.
>From your patch:

- patlen != namelen - 5 && - prefixcmp(name, "refs/heads/") && - prefixcmp(name, "refs/tags/")) { + patlen != namelen - STRLEN_PATH_REFS_HEADS && + prefixcmp(name, PATH_REFS_HEADS) && + prefixcmp(name, PATH_REFS_HEADS)) {

This is totally bogus. You meant STRLEN_PATH_REFS, and the second path should be PATH_REFS_TAGS. With those changes, t5516 passes.

I haven't combed through your patch in detail, so there might be similar problems lurking. I did notice one or two spots where you call strlen(PATH_REFS_*), which should of course also be changed to STRLEN_PATH_REFS_*.

And as a final comment, your patch doesn't apply to next at all because of the reorganization of the fetching API (e.g., fetch-pack.c doesn't exist at all anymore). You should probably prepare a parallel patch for next.

-Peff
Previous: Andy ParkinsNext: Andy Parkins
Message 3 of 19 in “Change "refs/" references to symbolic constants”
  1. 1/2 Change "refs/" references to symbolic constantsAndy Parkins, Sep 29, 2007
  2. Andy ParkinsOct 1, 2007
  3. Jeff KingOct 2, 2007
  4. Andy ParkinsOct 2, 2007
  5. Jeff KingOct 2, 2007
  6. Change "refs/" references to symbolic constantsAndy Parkins, Oct 2, 2007
  7. Jeff KingOct 2, 2007
  8. Junio C HamanoOct 2, 2007
  9. Jeff KingOct 2, 2007
  10. Junio C HamanoOct 3, 2007
  11. Jeff KingOct 3, 2007
  12. Johannes SchindelinOct 3, 2007
  13. Jeff KingOct 3, 2007
  14. Andreas EricssonOct 3, 2007
  15. Andy ParkinsOct 3, 2007
  16. Andy ParkinsOct 3, 2007
  17. Andy ParkinsOct 3, 2007
  18. Junio C HamanoOct 2, 2007
  19. Andy ParkinsOct 3, 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.