From: Junio C Hamano <gitster@pobox.com>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org, Jeff King <peff@peff.net>
Subject: Re: [PATCH 4/4] push: add 'prune' option
Date: Wed, 22 Feb 2012 16:42:33 -0800 [thread overview]
Message-ID: <7v1upm8jnq.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1329950621-21165-5-git-send-email-felipe.contreras@gmail.com> (Felipe Contreras's message of "Thu, 23 Feb 2012 00:43:41 +0200")
Felipe Contreras <felipe.contreras@gmail.com> writes:
> +--prune::
> + Remove remote branches that don't have a local counterpart. For example
> + a remote branch `tmp` will be removed if a local branch with the same
> + name doesn't exist any more. This also respects refspecs, e.g.
> + `refs/heads/*:refs/tmp/*` would make sure that remote `refs/tmp/foo`
> + will be removed if `refs/heads/foo` doesn't exist.
I do not think it adds much useful information to mention `tmp` only once
over what is already said by the first sentence. Also, the first sentence
of the example does not make it clear that it is assuming a same-for-same
mapping.
Coming up with a precise technical description is easy, but it is hard to
explain to the end user in easy terms, and I commend you for attempting to
add an example in a short single sentence, though.
Perhaps spelling out the underlying assumption the example makes is the
best we could do here without going too technical.
... For example, if you are pushing all your local branches to
update the local branches of the remote, `tmp` branch will be
removed from the remote if you removed your `tmp` branch locally.
If you are pushing all your local branches on your laptop to a
repository on your desktop machine under `refs/remotes/laptop/`
hierarchy to back them up, `refs/remotes/laptop/tmp` is removed
from the remote if you no longer have the branch `tmp` on your
laptop.
Will queue with a slight fix-ups, including this bit:
> diff --git a/remote.h b/remote.h
> index b395598..341142c 100644
> --- a/remote.h
> +++ b/remote.h
> @@ -145,7 +145,8 @@ int branch_merge_matches(struct branch *, int n, const char *);
> enum match_refs_flags {
> MATCH_REFS_NONE = 0,
> MATCH_REFS_ALL = (1 << 0),
> - MATCH_REFS_MIRROR = (1 << 1)
> + MATCH_REFS_MIRROR = (1 << 1),
> + MATCH_REFS_PRUNE = (1 << 2),
> };
Lose the ',' at the end, for the same reason why deleted line did not have
one.
Thanks.
next prev parent reply other threads:[~2012-02-23 0:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-22 22:43 [PATCH 0/4] push: add 'prune' option Felipe Contreras
2012-02-22 22:43 ` [PATCH 1/4] remote: use a local variable in match_push_refs() Felipe Contreras
2012-02-22 22:43 ` [PATCH 2/4] remote: reorganize check_pattern_match() Felipe Contreras
2012-02-22 22:43 ` [PATCH 3/4] remote: refactor code into alloc_delete_ref() Felipe Contreras
2012-02-22 22:43 ` [PATCH 4/4] push: add 'prune' option Felipe Contreras
2012-02-23 0:42 ` Junio C Hamano [this message]
2012-02-23 1:09 ` Felipe Contreras
2012-02-23 1:31 ` Junio C Hamano
2012-02-23 2:30 ` Felipe Contreras
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=7v1upm8jnq.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).