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

Re: git fetch documentation

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 1, 2013, 11:25 UTC
Message-ID
<CALkWK0mqkOZ__Gk-5VUpzLCaUHx1kA1JTrFunF3tUSeX6tDkgA@mail.gmail.com>
In-Reply-To
<87sj12rt13.fsf@yahoo.fr>
Nicolas Richard wrote:
Show 10 quoted lines
> - A '*' can be used both in src and dest, and it matches any name,
>   including subdirectories, but not partial names (i.e. refs/heads/foo*
>   is invalid).
> - multiple fetch lines can be given in .git/config, each of them will be
>   obeyed
>
> These are probably obvious for most users, but I think documenting them
> would be good for newcomers. (I tried to come up with a patch but I
> can't find a precise yet concise way to explain the role of '*' in
> english.)

Good. Yes, we don't even have examples showing that a rewrite like refs/heads/nr/*:refs/heads/* can be done. The documentation is definitely lacking. However, I'd urge you to get started by submitting an initial draft: we will review it and help you learn and contribute. Some pointers:

- What you are attempting to document is called a refspec.  Look at
'struct refspec' in remote.h, and attempt to understand what its
fields mean by looking at how it is used in remote.c.
- Notice that there is a push refspec corresponding to the fetch
refspec.  This feature is even more obscure and undocumented.
- See remote.c:get_ref_match(); specifically,
match_name_with_pattern() is doing the pattern matching.  As you can
see, match_name_with_pattern() hard-codes a '*' and tries to match
just that: there is no support for anything else.  Try to skim through
the code once.
- Read Documentation/SubmittingPatches and submit a first version
quickly.  It doesn't have to be perfect at all.
Previous: Nicolas Richard
Message 2 of 2 in “git fetch documentation”
  1. Nicolas RichardJun 1, 2013
  2. Ramkumar RamachandraJun 1, 2013

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.