Re: Re: Pull is Evil
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 2, 2014, 00:37 UTC
- Message-ID
- <5362e8b09aba1_429131b31038@nysa.notmuch>
- In-Reply-To
- <20140502000208.GB28634@odin.tremily.us>
W. Trevor King wrote:
Show 22 quoted lines
> On Thu, May 01, 2014 at 06:25:16PM -0500, Felipe Contreras wrote: > > W. Trevor King wrote: > > > On Thu, May 01, 2014 at 12:48:46PM -0700, W. Trevor King wrote: > > > > My interest in all of the proposed git-pull-training-wheel patches is > > > > that they give users a way to set a finger-breaking configuration that > > > > makes pull a no-op (or slows it down, like 'rm -i …'). Then folks who > > > > compulsively run 'git pull' (e.g. because SVN habits die slowly) can > > > > set an option that gives them something to think about before going > > > > ahead and running the pull anyway. > > > > > > Actually, what do we think about an -i/--interactive flag (with an > > > associated pull.interactive boolean config to setup global/per-repo > > > defaults)? Then after the fetch, you'd get one of the following: > > > > > > Merge $count commits from $repository $refspec into $current_branch? > > > Rebase $count commits from $current_branch onto $repository $refpec? > > > > Not much interactivity in those options. Maybe --prompt would make more > > sense. > > I think matching rm, mv, cp, etc. is good, but I'd be ok with > --prompt.
Those are actually interactive. `git mergetool --prompt` is an exactly of a configration where it's interactivity is constrainted to a single input.
Show 5 quoted lines
> > > Fast-forward $current_branch by $count commits to $repository $refpec? > > > > Why would anyone say 'no' to this one? > > Because the want explicit merges when they bring in topic branches?
If that was the case the user wouls have run `git merge --no-ff`. Only expereinced users would answer 'no'.
Show 9 quoted lines
> > > and have a chance to bail out if you saw: > > > > > > Merge 1003 commits from git://example.net/main.git master into my-feature? > > > > > > because you forgot which branch you were on. > > > > Yes, that might be nice. But we still need to change the defaults. > > So I should submit an orthogonal patch with -i/--interative/--prompt?
I'm not entirely sure what would be the ideal behavior.
For example, I'm thinking that by default when the a fast-forward is possible, just do it, when it's not, ask if the user wants to do a merge or a rebase, if the user just press 'enter' a merge is attempted.
In addition a summary of the commits ahead behind would be helpful.
If the user wants to cancel the operation, he can just do CTRL+C.
-- Felipe Contreras