Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-07 Thread Erwan Mathoniere
On 06/06/2016 18:29, Philip Oakley wrote: + that each one tracks the remote branch pulled from. If a configuration + already exists, it is overwriten. For example, with `git pull -u origin + branch` the current branch will track `branch` from `origin`. ++ +If two or more branches are pulled on

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-07 Thread Erwan Mathoniere
On 06/06/2016 21:06, Junio C Hamano wrote: But I am unhappy with a more serious problem with the tests in this patch. They assume that "-u" option will forever be the only thing that is allowed to modify the configuration during "git pull -u". It should never make such an assumption. The onl

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-07 Thread Erwan Mathoniere
On 07/06/2016 09:06, Matthieu Moy wrote: Junio C Hamano writes: Matthieu Moy writes: +test_config_unchanged () { + git config --list --local >original + "$@" + git config --list --local >modified + test_cmp original modified +} The test passes if "$@" fails. You

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-07 Thread Erwan Mathoniere
On 06/06/2016 17:54, Matthieu Moy wrote: Erwan Mathoniere writes: @@ -497,6 +504,10 @@ static void NORETURN die_no_merge_candidates(const char *repo, const char **refs fprintf(stderr, "\n"); fprintf_ln(stderr, _("If you wish to set tracking information for t

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-07 Thread Matthieu Moy
Junio C Hamano writes: > Matthieu Moy writes: > >>> +test_config_unchanged () { >>> + git config --list --local >original >>> + "$@" >>> + git config --list --local >modified >>> + test_cmp original modified >>> +} >> >> The test passes if "$@" fails. You should &&-chain the lines here t

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-06 Thread Junio C Hamano
Matthieu Moy writes: >> +test_config_unchanged () { >> +git config --list --local >original >> +"$@" >> +git config --list --local >modified >> +test_cmp original modified >> +} > > The test passes if "$@" fails. You should &&-chain the lines here to > catch things like crashes or

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-06 Thread Philip Oakley
From: "Erwan Mathoniere" Implement `git pull [--set-upstream | -u] ` that set tracking to the remote branch the user just pulled from. After successfully pulling from ``, for each `` described in format `:`, set `branch..remote` to `` and `branch..merge` to `refs/heads/`. If `` lacks `` in the

Re: [RFC/PATCH v2] pull: add --set-upstream

2016-06-06 Thread Matthieu Moy
Erwan Mathoniere writes: > @@ -497,6 +504,10 @@ static void NORETURN die_no_merge_candidates(const char > *repo, const char **refs > fprintf(stderr, "\n"); > fprintf_ln(stderr, _("If you wish to set tracking information > for this branch you can do so with:")); >

[RFC/PATCH v2] pull: add --set-upstream

2016-06-06 Thread Erwan Mathoniere
Implement `git pull [--set-upstream | -u] ` that set tracking to the remote branch the user just pulled from. After successfully pulling from ``, for each `` described in format `:`, set `branch..remote` to `` and `branch..merge` to `refs/heads/`. If `` lacks `` in the previous format or directly