From: Michael Haggerty <mhagger@alum.mit.edu>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
Michael Haggerty <mhagger@alum.mit.edu>
Subject: [RFC 00/11] Make reference pruning more configurable
Date: Wed, 4 Dec 2013 06:44:39 +0100 [thread overview]
Message-ID: <1386135890-13954-1-git-send-email-mhagger@alum.mit.edu> (raw)
This patch series applies on top of
mh/fetch-tags-in-addition-to-normal-refs
and has some minor conflicts with that branch (mostly related to
documentation).
Let me state in advance that I personally think that the features
implemented in this patch series are overkill. But since it was
already implemented, I thought I would throw it out there and see if
anybody likes it.
This patch series makes it possible for the user to specify explicitly
which reference namespaces should be subjected to pruning when
fetching from a remote.
* It allows a <pattern> to be passed to the --prune option for the
following commands:
git fetch --prune=<pattern> [...]
git remote update --prune=<pattern> [...]
git remote prune --prune=<pattern> [...]
Only references that match the specified pattern(s) are
considered for pruning.
git remote show --prune=<pattern> [...]
Only show prunable references that match the specified
pattern(s).
The --prune=<pattern> option can be specified multiple times.
* It introduces the following multivalued configuration values:
fetch.pruneRef
remote.<name>.pruneRef
Configuration settings for setting the default
"--prune=<pattern>" options, globally and per-remote.
Background: I started working on this feature as my first approach to
solving the problem that
git fetch --tags --prune
can nuke tags unrelated to the remote being fetched from. Only later
did I hit upon the better solution that is implemented in
mh/fetch-tags-in-addition-to-normal-refs, namely to change the
semantics of the --tags option to *not* subject tags to pruning.
But even though "--prune=<pattern>" is no longer needed to prevent tag
nuking, it might be useful to somebody for other purposes, and
therefore I am submitting it to the list as an RFC. Maybe there is a
use case associated with non-branch, non-tag references, like perhaps
Gerrit pull request-related references?
Personally, I am -0 on this series. I think it adds more complication
(code, documentation, etc) than its usefulness justifies. I think the
functionality in mh/fetch-tags-in-addition-to-normal-refs (which we
want in any case!) will satisfy 99% of users and I can't think of use
cases where additional configurability of reference pruning is needed.
So, if anybody can think of a compelling use case for this feature,
please make your case!
Michael
Michael Haggerty (11):
get_stale_heads(): allow limiting to refname patterns
remote.c: add infrastructure for parsing --prune options
fetch: use the new functions for handling --prune options
remote: use the new functions for handling --prune options
remote.c: add infrastructure to handle --prune=<pattern>
fetch --prune: allow refname patterns to be specified
remote update --prune: allow refname patterns to be specified
string_list_append_list(): new function
remote prune: allow --prune=<pattern> options
remote show: allow --prune=<pattern> options
remote: allow prune patterns to be configured
Documentation/config.txt | 28 ++++--
Documentation/fetch-options.txt | 13 ++-
Documentation/git-remote.txt | 29 +++++--
Documentation/technical/api-string-list.txt | 10 ++-
builtin/fetch.c | 43 +++------
builtin/remote.c | 85 ++++++++++++------
remote.c | 130 +++++++++++++++++++++++++++-
remote.h | 48 +++++++++-
string-list.c | 9 ++
string-list.h | 8 ++
t/t5505-remote.sh | 88 +++++++++++++++++++
t/t5510-fetch.sh | 25 ++++++
12 files changed, 441 insertions(+), 75 deletions(-)
--
1.8.4.3
next reply other threads:[~2013-12-04 5:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-04 5:44 Michael Haggerty [this message]
2013-12-04 5:44 ` [RFC 01/11] get_stale_heads(): allow limiting to refname patterns Michael Haggerty
2013-12-04 5:44 ` [RFC 02/11] remote.c: add infrastructure for parsing --prune options Michael Haggerty
2013-12-04 12:57 ` Duy Nguyen
2013-12-04 17:04 ` Michael Haggerty
2013-12-04 5:44 ` [RFC 03/11] fetch: use the new functions for handling " Michael Haggerty
2013-12-04 5:44 ` [RFC 04/11] remote: " Michael Haggerty
2013-12-04 5:44 ` [RFC 05/11] remote.c: add infrastructure to handle --prune=<pattern> Michael Haggerty
2013-12-04 5:44 ` [RFC 06/11] fetch --prune: allow refname patterns to be specified Michael Haggerty
2013-12-04 5:44 ` [RFC 07/11] remote update " Michael Haggerty
2013-12-04 5:44 ` [RFC 08/11] string_list_append_list(): new function Michael Haggerty
2013-12-04 5:44 ` [RFC 09/11] remote prune: allow --prune=<pattern> options Michael Haggerty
2013-12-04 5:44 ` [RFC 10/11] remote show: " Michael Haggerty
2013-12-04 5:44 ` [RFC 11/11] remote: allow prune patterns to be configured Michael Haggerty
2013-12-04 20:25 ` [RFC 00/11] Make reference pruning more configurable Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386135890-13954-1-git-send-email-mhagger@alum.mit.edu \
--to=mhagger@alum.mit.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).