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 17:31:01 -0800 [thread overview]
Message-ID: <7vlinu72ui.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAMP44s1s_NeXeUpxDR0cLoLGjSaf-0E_62MzAxeiHS=-6c045A@mail.gmail.com> (Felipe Contreras's message of "Thu, 23 Feb 2012 03:09:00 +0200")
Felipe Contreras <felipe.contreras@gmail.com> writes:
> On Thu, Feb 23, 2012 at 2:42 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Yeah, but that's 'git push --all', and that's not the common
> operation--'git push' is.
"git push" is common but that does not give you a solid base to guess what
the reader's assumption would be. Are you assuming "matching" semantics?
> So that's what I presumed the reader would
> assume,...
I do not want let us guess what the reader assumes, as many people seem to
suggest setting push.default to different values and that would change
what the reader would assume. That was the whole reason that I suggested
to spell the assumption out, so that the reader's assumption does not have
to get into the picture.
> This reuses the name `tmp`, which seems to be your objective, but it
> doesn't explain _why_ it would remove `tmp`; is it because `tmp` is
> the upstream branch, or is it because it has the same name?
The example is to clarify "local counterpart" in the main text. I
actually would prefer to get rid of `tmp` but I left it as-is as you
wrote. The exact name used in the example does not matter, whether it is
`tmp` or `xyzzy`.
> Unfortunately, I as a reader have trouble understanding this. More
> specifically I have trouble understanding where `refs/remotes/laptop/`
> is coming from, and what it is meaning. I have always pictured
> `refs/remotes` as something that 'git fetch' updates, and always from
> the relevant repository.
The layout is the recommended set-up to emulate a fetch with a push in the
reverse direction, which I thought anybody should notice. It is a failure
in our documentation that even an expert didn't.
>>> 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.
>
> And why is that?
Because I told you so ;-).
More seriously, we have had patches to accomodate other people's compilers
by dropping the last comma in enum {}. See c9b6782 (enums: omit trailing
comma for portability, 2011-03-16), 4b05548 (enums: omit trailing comma
for portability, 2010-05-14) for examples.
next prev parent reply other threads:[~2012-02-23 1:31 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
2012-02-23 1:09 ` Felipe Contreras
2012-02-23 1:31 ` Junio C Hamano [this message]
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=7vlinu72ui.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).