Re: [PATCH 6/6] push: honor branch.*.push
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2013, 08:17 UTC
- Message-ID
- <7vhagndis4.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CALkWK0=aDkCMB3ROSuH1crTmQKjCFyCmvJfvOTiQnBo4+NckBA@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 15 quoted lines
> Junio C Hamano wrote:
>> @@ -194,7 +203,14 @@ static int is_workflow_triagular(struct remote *remote)
>> static void setup_default_push_refspecs(struct remote *remote)
>> {
>> struct branch *branch = branch_get(NULL);
>> - int triangular = is_workflow_triagular(remote);
>> + int triangular;
>> +
>> + if (branch->push_name) {
>> + setup_per_branch_push(branch);
>> + return;
>> + }
>
> The most obvious question comes first: what result can I expect when
> this interacts with remote.<name>.push?Now you bring it up, the branch.*.push may want to be more specific (when I am on _this_ branch, do this) than remote.*.push (when I am pushing to that remote, I want this to happen in general), but this default codepath would not be exercised when you have remote.*.push, so the logic may need to be moved higher up in the foodchain.
Show 8 quoted lines
> Also, you managed to throw out all safety out the window. What > happens when the user does: > > # on branch master, derived from origin > $ git push ram > > And branch.master.push is set to next? Will you let her shoot herself > in the foot like this?
It is not shooting in the foot, if branch.master.push is explicitly set to update next. I do not see any issue in that part.
But the relative strength betweenh branch.*.push and remote.*.push may need to be thought out. I haven't.