Re: [RFC/PATCH v2] pull: add --set-upstream
- From
Erwan Mathoniere <erwan.mathoniere@grenoble-inp.org>
- Date
- Jun 7, 2016, 13:15 UTC
- Message-ID
- <af8762b1-3865-5d10-296c-db9bf9e8aa53@grenoble-inp.org>
- In-Reply-To
- <xmqqoa7ew319.fsf@gitster.mtv.corp.google.com>
On 06/06/2016 21:06, Junio C Hamano wrote:
Show 16 quoted lines
> > 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 only thing these additional tests later in the patch (ommitted) > want to check, if I understand them correctly, is that when -u is > used on a ref that shouldn't be tracked from the given remote then > remote.<that remote>.merge etc. are not updated. Make a list of the > configuration variables the feature cares about, and check them and > ignore changes to any other variable. Somebody else's feature that > will be added to "git pull" may have legitimate reason to update > configuration variables that are not releated to this feature, and > you shouldn't be writing your test for your feature in such a way > to forbid such a new feature by others from being added.
I asked myself these questions but I came to the wrong conclusion since I considered that testing if `--set-upstream` doesn't alter any configuration var it shouldn't was also important. But there is no reason "git pull -u" modify the configuration in such a chaotic way.
I'll apply your suggestions, thanks.