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

Re: [PATCH 6/6] refactor fetch's ref matching to use ref_abbrev_matches_full_with_rules()

From
Jakub Narebski <jnareb@gmail.com>
Date
Nov 11, 2007, 14:55 UTC
Message-ID
<fh7548$15u$1@ger.gmane.org>
In-Reply-To
<11947897092576-git-send-email-prohaska@zib.de>
Steffen Prohaska wrote:
Show 29 quoted lines
> The old rules used by fetch were coded as a series of ifs.  The old
> rules are:
> 1) match full refname if it starts with "refs/" or matches "HEAD"
> 2) verify that full refname starts with "refs/"
> 3) match abbreviated name in "refs/" if it starts with "heads/",
>     "tags/", or "remotes/".
> 4) match abbreviated name in "refs/heads/"
> 
> This is replaced by the new rules
> a) match full refname
> b) match abbreviated name prefixed with "refs/"
> c) match abbreviated name prefixed with "refs/heads/"
> 
> The details of the new rules are different from the old rules.  We no
> longer verify that the full refname starts with "refs/".  The new rule
> (a) matches any full string.  The old rules (1) and (2) were stricter.
> Now, the caller is responsible for using sensible full refnames.  This
> should be the case for the current code.  The new rule (b) is less
> strict than old rule (3).  The new rule accepts abbreviated names that
> start with a non-standard prefix below "refs/".
> 
> Despite this modifications the new rules should handle all cases as
> expected.  Two tests are added to verify that fetch does not resolve
> short tags or HEAD in remotes.
> 
> We may even think about loosening the rules a bit more and unify them
> with the rev-parse rules.  This would be done by replacing
> ref_ref_fetch_rules with ref_ref_parse_rules.  Note, the two new test
> would break.
Does still "origin" matches "origin/HEAD" if we have emote "origin"?
-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 8 of 18 in “improve refspec handling in push, refactor matching in fetch”
  1. 0/6 improve refspec handling in push, refactor matching in fetchSteffen Prohaska, Nov 11, 2007
  2. 1/6 push: mention --verbose option in documentationSteffen Prohaska, Nov 11, 2007
  3. 2/6 push: teach push to pass --verbose option to transport layerSteffen Prohaska, Nov 11, 2007
  4. 3/6 push: support pushing HEAD to real branch nameSteffen Prohaska, Nov 11, 2007
  5. 4/6 add ref_abbrev_matches_full_with_rules()Steffen Prohaska, Nov 11, 2007
  6. 5/6 push: use same rules as git-rev-parse to resolve refspecsSteffen Prohaska, Nov 11, 2007
  7. 6/6 refactor fetch's ref matching to use ref_abbrev_matches_full_with_rules()Steffen Prohaska, Nov 11, 2007
  8. Jakub NarebskiNov 11, 2007
  9. Steffen ProhaskaNov 11, 2007
  10. Junio C HamanoNov 12, 2007
  11. Steffen ProhaskaNov 12, 2007
  12. Junio C HamanoNov 12, 2007
  13. Steffen ProhaskaNov 12, 2007
  14. Andreas EricssonNov 11, 2007
  15. 3/6 push: support pushing HEAD to real branch nameSteffen Prohaska, Nov 11, 2007
  16. Steffen ProhaskaNov 11, 2007
  17. Steffen ProhaskaNov 11, 2007
  18. Junio C HamanoNov 11, 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.