git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Björn Steinbrink" <B.Steinbrink@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Julian Phillips <julian@quantumfyre.co.uk>,
	Daniel Barkalow <barkalow@iabervon.org>,
	James Pickens <jepicken@gmail.com>, Jeff King <peff@peff.net>,
	Nicolas Pitre <nico@fluxnic.net>,
	Jay Soffian <jaysoffian@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was
Date: Sat, 17 Oct 2009 10:40:25 +0200	[thread overview]
Message-ID: <20091017084025.GC5474@atjola.homenet> (raw)
In-Reply-To: <7vws2ue8yc.fsf@alter.siamese.dyndns.org>

On 2009.10.17 01:11:23 -0700, Junio C Hamano wrote:
> Björn Steinbrink <B.Steinbrink@gmx.de> writes:
> 
> > ... If so, it does a "git checkout --merge
> > <upstream>" (possibly leaving conflicts for the uncommitted changes,
> > just like "svn update").
> 
> Up to this point I was reading with quite a lot of interest.  But here I
> strongly disagree to the point of getting actually disgusted.
> 
> "svn up" is one of the areas Subversion folks failed to make their system
> a better CVS.  It has the same "local changes are lost in the merge
> conflict mess in an irreversible way" failure mode, and we shouldn't be
> making it easy to new people.  It is not something we should emulate.
> 
> You can and should instead refuse the update, and suggest committing first
> so that the user has a safe record of what he has done and the merge with
> upstream can be retried if necessary.  As you need to have that "refuse
> but guide the lost soul by telling what to do" mode anyway when...

Hm, probably I (mentally) focussed to much on "people that just want to
look" and didn't really think that they'd have much to lose. Not sure.
Over the time, I got so used to do "git checkout --merge <something>"
with some I-don't-care-much debugging or whatever change, that I lost
track of how bad that was with svn. If I have just I care about, I
commit, and then "git update" would no longer be an option anyway. But
yeah, not a good option to give to the uninitiated user...

Interestingly, I irregularly give advice to use "git stash; git
checkout; git stash apply" instead of "git checkout -m" on #git, as that
allows you to try again if you messed up the conflict resolution, and
even allows you to completely go back to the initial state. Maybe that
would be an option? But I fail to come up with a convenient and at the
same time error safe way for such a "stash wrap". The only thing that
comes to mind would be to have "git update" completely wrapping the
thing:

git update
 - Stashes uncommitted changes
 - fetches
 - checks out
 - "stash apply --index", if that fails, just "stash apply"

If there are conflicts, show options (similar to what rebase does):

git update --retry # Start over
 - reset --hard
 - "stash apply --index", if that fails, just "stash apply"

git update --abort
 - git reset --hard HEAD@{1}
 - "stash apply --index"
 - "stash drop stash@{0}"

git update --done
 - Check whether there are still unmerged files, if so: complain
 - otherwise: "stash drop stash@{0}"


OTOH, it might be easier to just tell the user to do the stash thing
himself. But I wonder how many users would really know how to get back
to the initial state then.

Björn

  reply	other threads:[~2009-10-17  8:43 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14  4:44 [PATCH] Proof-of-concept patch to remember what the detached HEAD was Daniel Barkalow
2009-10-14  5:07 ` Junio C Hamano
2009-10-14  5:08 ` Jeff King
2009-10-14 10:33   ` Johannes Schindelin
2009-10-14 15:39     ` Jeff King
2009-10-14 18:34       ` Junio C Hamano
2009-10-14 18:40         ` Jeff King
2009-10-14 15:56   ` Daniel Barkalow
2009-10-14 18:56 ` Jay Soffian
2009-10-14 19:15   ` Daniel Barkalow
2009-10-14 20:18     ` Nicolas Pitre
2009-10-14 20:37       ` Daniel Barkalow
2009-10-14 20:42       ` Junio C Hamano
2009-10-14 20:48         ` Nicolas Pitre
2009-10-14 22:34           ` Junio C Hamano
2009-10-14 23:09             ` Jeff King
2009-10-14 23:34               ` Nicolas Pitre
2009-10-15  0:56                 ` Junio C Hamano
2009-10-15  1:47                   ` Jeff King
2009-10-15  3:08                     ` Nicolas Pitre
2009-10-15  4:21                       ` Jeff King
2009-10-16  1:04                       ` Johannes Schindelin
2009-10-16  1:36                         ` Nicolas Pitre
2009-10-16  2:07                           ` Johannes Schindelin
2009-10-16  2:45                             ` Nicolas Pitre
2009-10-16  2:56                             ` Junio C Hamano
2009-10-17  7:24                             ` Sean Estabrooks
2009-10-26 22:22                               ` Johannes Schindelin
2009-10-27  3:41                                 ` Nanako Shiraishi
2009-10-27 10:33                                   ` Making Git easy to use -- without RTFM, was " Johannes Schindelin
2009-10-27 17:58                                     ` Avery Pennarun
2009-10-16  0:53                   ` Johannes Schindelin
2009-10-16  3:00                     ` Junio C Hamano
2009-10-15  7:36               ` James Pickens
2009-10-15 12:54                 ` Jakub Narebski
2009-10-15 14:11                   ` Björn Steinbrink
2009-10-15 19:03                   ` Nicolas Pitre
2009-10-15 15:36                 ` Daniel Barkalow
2009-10-15 16:29                   ` Michael J Gruber
2009-10-15 19:07                   ` Nicolas Pitre
2009-10-15 19:22                     ` Daniel Barkalow
2009-10-15 22:56                       ` Thomas Rast
2009-10-15 18:51                 ` Nicolas Pitre
2009-10-15 19:52                   ` Junio C Hamano
2009-10-15 21:26                     ` Jeff King
2009-10-15 21:54                       ` Junio C Hamano
2009-10-15 22:08                         ` Junio C Hamano
2009-10-15 23:16                           ` Nicolas Pitre
2009-10-15 23:47                           ` James Pickens
2009-10-16  0:34                             ` Nicolas Pitre
2009-10-16  0:43                             ` Johannes Schindelin
2009-10-16  5:03                             ` Björn Steinbrink
2009-10-15 22:16                         ` Jeff King
2009-10-15 22:17                           ` Jeff King
2009-10-16  4:29                         ` Björn Steinbrink
2009-10-16  6:02                           ` Daniel Barkalow
2009-10-16  8:27                             ` Björn Steinbrink
2009-10-16 15:44                             ` Nicolas Pitre
2009-10-15 19:31                 ` Daniel Barkalow
2009-10-15 20:34                   ` Junio C Hamano
2009-10-15 21:35                     ` Daniel Barkalow
2009-10-15 21:48                       ` Nicolas Pitre
2009-10-16 12:15                   ` Julian Phillips
2009-10-16 14:30                     ` Björn Steinbrink
2009-10-16 17:31                       ` Julian Phillips
2009-10-16 18:29                         ` Daniel Barkalow
2009-10-16 19:05                         ` Junio C Hamano
2009-10-16 19:48                           ` Julian Phillips
2009-10-16 20:19                             ` Nicolas Pitre
2009-10-17 15:15                               ` Julian Phillips
2009-10-17 17:04                                 ` Björn Steinbrink
2009-10-17 17:35                                   ` Julian Phillips
2009-10-17 17:48                                     ` Björn Steinbrink
2009-10-17 22:28                                       ` Julian Phillips
2009-10-16 20:19                             ` Junio C Hamano
2009-10-17 15:32                               ` Julian Phillips
2009-10-17 17:43                                 ` Junio C Hamano
2009-10-17 22:19                                   ` Julian Phillips
2009-10-17  7:55                         ` Björn Steinbrink
2009-10-17  8:11                           ` Junio C Hamano
2009-10-17  8:40                             ` Björn Steinbrink [this message]
2009-10-17  9:04                               ` Junio C Hamano
2009-10-17 17:07                                 ` James Pickens
2009-10-17 19:41                                 ` Björn Steinbrink
2009-10-18 22:47                                   ` Junio C Hamano
2009-10-19  8:44                                     ` Björn Steinbrink
2009-10-17 15:02                           ` Julian Phillips
2009-10-14 23:52         ` Eric Raible
2009-10-16 22:36 ` Christoph Bartoschek
2009-10-17  7:43   ` Junio C Hamano
2009-10-17  8:19     ` Björn Steinbrink
2009-10-17 17:42       ` Junio C Hamano
2009-10-17 20:35     ` Daniel Barkalow

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=20091017084025.GC5474@atjola.homenet \
    --to=b.steinbrink@gmx.de \
    --cc=barkalow@iabervon.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jaysoffian@gmail.com \
    --cc=jepicken@gmail.com \
    --cc=julian@quantumfyre.co.uk \
    --cc=nico@fluxnic.net \
    --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).