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

Re: Local tag killer

From
Jeff King <peff@peff.net>
Date
Sep 24, 2013, 07:51 UTC
Message-ID
<20130924075119.GD7257@sigill.intra.peff.net>
In-Reply-To
<523D3FD2.4090002@alum.mit.edu>
On Sat, Sep 21, 2013 at 08:42:26AM +0200, Michael Haggerty wrote:
> I think it would be preferable if "--prune" would *not* affect tags, and
> if there were an extra option like "--prune-tags" that would have to be
> used explicitly to cause tags to be pruned.  Would somebody object to
> such a change?

I think most of this problem is the way that we fetch tags straight into the refs/tags hierarchy. You would not do:

  [remote "origin"]
  fetch = +refs/heads/*:refs/heads/*
  prune = true

unless you wanted to be a pure-mirror, because you would hose your local changes any time you fetched. But that is _exactly_ what we do with a refs/tags/*:refs/tags/* fetch.

If we instead moved to a default fetch refspec more like:
  [remote "origin"]
  fetch = +refs/*:refs/remotes/origin/refs/*

Then everything would Just Work. If you prune what the other side has locally, that's fine. All you're doing is pruning your view of what he has, not anything you've done locally.

The tricky part is tweaking the lookup rules so that "origin/master" still works, and that looking for "v1.0" checks both refs/tags and refs/remotes/*/refs/tags. And of course managing backwards compatibility. :)

In the meantime, I'd almost be tempted to say that "--prune" should refuse to work when we are touching anything outside of refs/remotes/. But that would make true mirrors fail, who do want to munge their local refs/heads/. You'd need some way to say "no, really, it's OK to prune". Maybe let remote.*.prune be "remotes", "always", or "none", and "true" maps to "remotes"? That's not backwards compatible, but it would be much safer.

-Peff
Previous: John SzakmeisterNext: Marc Branchaud
Message 6 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.