git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [BUG] git remote prune removes local tags, depending on fetch config
@ 2018-01-15 21:16 Michael Giuffrida
  2018-01-16  0:38 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 118+ messages in thread
From: Michael Giuffrida @ 2018-01-15 21:16 UTC (permalink / raw)
  To: git

`git remote prune <name>` should "delete all stale remote-tracking
branches under <name>". I was surprised to discover, after some
troubleshooting, that it also deletes *all* local tags that don't
exist on the remote, if the following refspec is included in the
remote's fetch config:

    +refs/tags/*:refs/tags/*

So, if `remote.origin.fetch` is configured to fetch all tags from the
remote, any tags I create locally will be deleted when running `git
remote prune origin`. This is not intuitive [1], nor is is it
explained in the docs [2]. Is this behavior obvious to someone with a
better understanding of Git internals?

I did find a better way to automatically fetch tags (using tagopt
instead of adding the fetch refspec). However, the refspec doesn't
seem "wrong" in itself; in particular, `git fetch --tags` used to be
considered equivalent to specifying the refspec
"refs/tags/*:refs/tags/*" -- implying that this is a sensible refspec
[3]. So I wouldn't expect it to "break" the behavior of another
command.

[1] https://stackoverflow.com/q/34687657/1327867
[2] https://git-scm.com/docs/git-remote.html#git-remote-empruneem
[3] https://github.com/git/git/commit/c5a84e92a2fe9e8748e32341c344d7a6c0f52a50

^ permalink raw reply	[flat|nested] 118+ messages in thread

end of thread, other threads:[~2018-02-24 21:42 UTC | newest]

Thread overview: 118+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15 21:16 [BUG] git remote prune removes local tags, depending on fetch config Michael Giuffrida
2018-01-16  0:38 ` Ævar Arnfjörð Bjarmason
2018-01-16  2:14   ` Michael Giuffrida
2018-01-16 11:14     ` Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 00/11] document & test fetch pruning + WIP fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 00/12] document & test fetch pruning & add fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 00/11] " Ævar Arnfjörð Bjarmason
2018-01-24 23:04             ` Junio C Hamano
2018-01-24 23:25               ` Ævar Arnfjörð Bjarmason
2018-02-06 16:23             ` Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 00/17] " Ævar Arnfjörð Bjarmason
2018-02-08 18:21               ` Ævar Arnfjörð Bjarmason
2018-02-08 19:48                 ` Junio C Hamano
2018-02-09 21:06                   ` Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 01/17] fetch: don't redundantly NULL something calloc() gave us Ævar Arnfjörð Bjarmason
2018-02-09  4:36               ` Eric Sunshine
2018-02-09 19:06                 ` Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 02/17] fetch: trivially refactor assignment to ref_nr Ævar Arnfjörð Bjarmason
2018-02-09  4:41               ` Eric Sunshine
2018-02-08 16:19             ` [PATCH v2 03/17] fetch: stop accessing "remote" variable indirectly Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 04/17] remote: add a macro for "refs/tags/*:refs/tags/*" Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 05/17] fetch tests: refactor in preparation for testing tag pruning Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 06/17] fetch tests: re-arrange arguments for future readability Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 07/17] fetch tests: add a tag to be deleted to the pruning tests Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 08/17] fetch tests: test --prune and refspec interaction Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 09/17] fetch tests: double quote a variable for interpolation Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 10/17] fetch tests: expand case/esac for later change Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 11/17] fetch tests: fetch <url> <spec> as well as fetch [<remote>] Ævar Arnfjörð Bjarmason
2018-02-09  5:17               ` Eric Sunshine
2018-02-09 20:05                 ` Ævar Arnfjörð Bjarmason
2018-02-09 20:27                   ` Jeff King
2018-02-09 21:14                     ` Eric Sunshine
2018-02-09 20:57                   ` Junio C Hamano
2018-02-09 21:13                     ` Junio C Hamano
2018-02-08 16:19             ` [PATCH v2 12/17] git fetch doc: add a new section to explain the ins & outs of pruning Ævar Arnfjörð Bjarmason
2018-02-09  5:26               ` Eric Sunshine
2018-02-08 16:19             ` [PATCH v2 13/17] git remote doc: correct dangerous lies about what prune does Ævar Arnfjörð Bjarmason
2018-02-09  5:33               ` Eric Sunshine
2018-02-08 16:19             ` [PATCH v2 14/17] git-fetch & config doc: link to the new PRUNING section Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 15/17] fetch tests: add scaffolding for the new fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 16/17] fetch: add a --fetch-prune option and fetch.pruneTags config Ævar Arnfjörð Bjarmason
2018-02-09  6:58               ` Eric Sunshine
2018-02-09  8:23                 ` Ævar Arnfjörð Bjarmason
2018-02-08 16:19             ` [PATCH v2 17/17] fetch: make the --fetch-prune work with <url> Ævar Arnfjörð Bjarmason
2018-02-09  7:03               ` Eric Sunshine
2018-02-09  8:22                 ` Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 01/11] fetch: don't redundantly NULL something calloc() gave us Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 02/11] fetch: stop accessing "remote" variable indirectly Ævar Arnfjörð Bjarmason
2018-01-24 20:53             ` Junio C Hamano
2018-01-23 22:13           ` [PATCH v3 03/11] fetch tests: refactor in preparation for testing tag pruning Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 04/11] fetch tests: re-arrange arguments for future readability Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 05/11] fetch tests: add a tag to be deleted to the pruning tests Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 06/11] fetch tests: test --prune and refspec interaction Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 07/11] git fetch doc: add a new section to explain the ins & outs of pruning Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 08/11] git remote doc: correct dangerous lies about what prune does Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 09/11] git-fetch & config doc: link to the new PRUNING section Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 10/11] fetch tests: add scaffolding for the new fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-01-23 22:13           ` [PATCH v3 11/11] fetch: add a --fetch-prune option and fetch.pruneTags config Ævar Arnfjörð Bjarmason
2018-01-24 20:52             ` Junio C Hamano
2018-01-24 21:03               ` Ævar Arnfjörð Bjarmason
2018-01-24 21:15                 ` Junio C Hamano
2018-02-09 20:31           ` [PATCH v5 00/17] document & test fetch pruning & add fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-02-22  0:23             ` Junio C Hamano
2018-02-22 14:18               ` Ævar Arnfjörð Bjarmason
2018-02-22 20:09                 ` Junio C Hamano
2018-02-23  9:04                   ` Ævar Arnfjörð Bjarmason
2018-02-23 21:10                     ` Junio C Hamano
2018-02-24 21:42                       ` Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 01/17] fetch: don't redundantly NULL something calloc() gave us Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 02/17] fetch: trivially refactor assignment to ref_nr Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 03/17] fetch: stop accessing "remote" variable indirectly Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 04/17] remote: add a macro for "refs/tags/*:refs/tags/*" Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 05/17] fetch tests: refactor in preparation for testing tag pruning Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 06/17] fetch tests: re-arrange arguments for future readability Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 07/17] fetch tests: add a tag to be deleted to the pruning tests Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 08/17] fetch tests: test --prune and refspec interaction Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 09/17] fetch tests: double quote a variable for interpolation Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 10/17] fetch tests: expand case/esac for later change Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 11/17] fetch tests: fetch <url> <spec> as well as fetch [<remote>] Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 12/17] git fetch doc: add a new section to explain the ins & outs of pruning Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 13/17] git remote doc: correct dangerous lies about what prune does Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 14/17] git-fetch & config doc: link to the new PRUNING section Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 15/17] fetch tests: add scaffolding for the new fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 16/17] fetch: add a --prune-tags option and fetch.pruneTags config Ævar Arnfjörð Bjarmason
2018-02-09 20:32           ` [PATCH v5 17/17] fetch: make the --prune-tags work with <url> Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 01/12] fetch tests: refactor in preparation for testing tag pruning Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 02/12] fetch tests: arrange arguments for future readability Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 03/12] fetch tests: add a tag to be deleted to the pruning tests Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 04/12] fetch tests: double quote a variable for interpolation Ævar Arnfjörð Bjarmason
2018-01-22 19:52           ` Junio C Hamano
2018-01-22 23:04             ` Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 05/12] fetch tests: test --prune and refspec interaction Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 06/12] git fetch doc: add a new section to explain the ins & outs of pruning Ævar Arnfjörð Bjarmason
2018-01-21  0:02         ` [PATCH v2 07/12] git remote doc: correct dangerous lies about what prune does Ævar Arnfjörð Bjarmason
2018-01-22 20:01           ` Junio C Hamano
2018-01-22 23:05             ` Ævar Arnfjörð Bjarmason
2018-01-21  0:03         ` [PATCH v2 08/12] git-fetch & config doc: link to the new PRUNING section Ævar Arnfjörð Bjarmason
2018-01-21  0:03         ` [PATCH v2 09/12] fetch: don't redundantly NULL something calloc() gave us Ævar Arnfjörð Bjarmason
2018-01-21  8:25           ` Ævar Arnfjörð Bjarmason
2018-01-21  0:03         ` [PATCH v2 10/12] fetch: stop accessing "remote" variable indirectly Ævar Arnfjörð Bjarmason
2018-01-21  0:03         ` [PATCH v2 11/12] fetch tests: add scaffolding for the new fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-01-21  0:03         ` [PATCH v2 12/12] fetch: add a --fetch-prune option and fetch.pruneTags config Ævar Arnfjörð Bjarmason
2018-01-22 20:50           ` Junio C Hamano
2018-01-22 23:48             ` Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 01/11] fetch tests: refactor in preparation for testing tag pruning Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 02/11] fetch tests: arrange arguments for future readability Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 03/11] fetch tests: add a tag to be deleted to the pruning tests Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 04/11] fetch tests: double quote a variable for interpolation Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 05/11] fetch tests: test --prune and refspec interaction Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 06/11] git fetch doc: add a new section to explain the ins & outs of pruning Ævar Arnfjörð Bjarmason
2018-01-19  0:46         ` Eric Sunshine
2018-01-19  0:00       ` [PATCH 07/11] git remote doc: correct dangerous lies about what prune does Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 08/11] git-fetch & config doc: link to the new PRUNING section Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 09/11] fetch: don't redundantly null something calloc() gave us Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [PATCH 10/11] fetch tests: add scaffolding for the new fetch.pruneTags Ævar Arnfjörð Bjarmason
2018-01-19  0:00       ` [RFC/PATCH 11/11] WIP fetch: add a --fetch-prune option and fetch.pruneTags config Ævar Arnfjörð Bjarmason
2018-01-16 11:48     ` [BUG] git remote prune removes local tags, depending on fetch config Andreas Schwab
2018-01-18  6:18       ` Kevin Daudt

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).