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

Re: Local tag killer

From
Johan Herland <johan@herland.net>
Date
Sep 29, 2013, 09:30 UTC
Message-ID
<CALKQrgdG3FzA=8A9TyuGGumqWJ05zYK1r2uaAOrhNaAUju-6jw@mail.gmail.com>
In-Reply-To
<5247ACB9.40208@alum.mit.edu>
On Sun, Sep 29, 2013 at 6:29 AM, Michael Haggerty <mhagger@alum.mit.edu> wrote:
Show 12 quoted lines
> I wonder whether remotes.group could sensibly be used to group remotes
> into logical groups for value lookups:
>
>     [remotes]
>             gitk = gitk-origin
>             gitk = second-gitk-repo
>
> Then DWIM could be taught to seek "gitk/foo" under
> "refs/remotes/gitk-origin/tags/foo" and
> "refs/remotes/second-gitk-repo/tags/foo" in addition to
> "refs/tags/gitk/foo" (insisting, of course, that if more than one of
> these are present that they are all consistent).

This is an interesting idea. AFAICS, remotes.<group> is currently only used by "git remote update" and "git fetch". According to git-remote(1) it's used like this:

    [git remote] update
        Fetch updates for a named set of remotes in the repository
        as defined by remotes.<group>. If a named group is not
        specified on the command line, the configuration parameter
        remotes.default will be used; if remotes.default is not
        defined, all remotes which do not have the configuration
        parameter remote.<name>.skipDefaultUpdate set to true will
        be updated. (See git-config(1)).
I believe this would work well when extended to ref lookup as well:
 - Defining remotes.$group allows you to lookup refs across the grouped
   remotes by using the "$group/<ref>" syntax, as you describe above.
 - If remotes.default is defined, ref lookup happens by default across
   only those remotes, i.e. "$tag" will be sought under refs/tags/$tag
   and then refs/remotes/$remote/tags/$tag for each $remote in
   remotes.default.
 - If remotes.default is not defined, ref lookup happens across all
   remotes. This is analogous to what happens with tags today; they
   are all dumped into refs/tags/* and lookup considers all of them.
Show 10 quoted lines
> Remote groups might also be used to configure the remotes that describe
> considers when describing a commit:
>
>     [remotes]
>             describe = junio
>             describe = jrn
>
> or maybe (using the above config)
>
>     git describe --remote-group=gitk
Hmm. I'd like to apply the same rules here, to stay consistent:
 - "git describe --from=$remote1 --from=$remote2" considers tags
   from refs/remotes/$remote1/tags/* and refs/remotes/$remote2/tags/*
 - "git describe --from=$group" considers tags from
   refs/remotes/$remote/tags/* for each $remote in $group
 - "git describe" considers tags from all remotes mentioned in
   remotes.default, or _all_ remotes is remotes.default is unset.
Additionally:
 - "git describe" (without --from) also considers (and prefers?) local
   tags.
 - "git describe --from=foo" does NOT consider local tags, but will
   also consider them if "--from=." is used.
...Johan

-- Johan Herland, <johan@herland.net> www.herland.net

Previous: Michael HaggertyNext: Marc Branchaud
Message 13 of 23 in “Local tag killer”
  1. Michael HaggertySep 13, 2013
  2. Junio C HamanoSep 13, 2013
  3. Junio C HamanoSep 20, 2013
  4. Michael HaggertySep 21, 2013
  5. John SzakmeisterSep 21, 2013
  6. Jeff KingSep 24, 2013
  7. Marc BranchaudSep 24, 2013
  8. Jeff KingSep 25, 2013
  9. Nicolas PitreSep 25, 2013
  10. Michael HaggertySep 28, 2013
  11. Johan HerlandSep 28, 2013
  12. Michael HaggertySep 29, 2013
  13. Johan HerlandSep 29, 2013
  14. Marc BranchaudSep 30, 2013
  15. Nicolas PitreSep 30, 2013
  16. Marc BranchaudSep 30, 2013
  17. Nicolas PitreSep 30, 2013
  18. Marc BranchaudSep 30, 2013
  19. Nicolas PitreSep 30, 2013
  20. Jeff KingSep 30, 2013
  21. Marc BranchaudOct 1, 2013
  22. Nicolas PitreOct 1, 2013
  23. Marc BranchaudOct 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.