Re: [PATCH] Proof-of-concept patch to remember what the detached HEAD was

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 17, 2009, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> As I already said many times (here and elsewhere), "up" is an inferior and
> more dangerous model we would be better off not following if we can.

I agree that the "up" model is inferior, but I have to say, "up" is one of the
most common things my users ask about.  It is very common for users to have some
work in progress that they aren't ready to commit, and they want to get up to
date with the latest code from the central repository.  Most of the time, they
haven't modified any files that have also been modified upstream, so all they
need is "git pull".  But once in a while, they will have modified the same file,
and the pull will be rejected, and they don't know what to do.

These are not sophisticated users, so telling them to commit first, then pull,
and rebase later on to clean up the history (since the work they committed
wasn't finished) is no good.  They don't care to preserve their exact state and
just want to get up to date with the central repo.

If they ask me what to do, I tell them that if they're ready to commit, do so,
otherwise use 'git stash; git pull; git stash pop'.  To a typical user, this
looks like Git is inferior since it requires 3 commands to do what only takes 1
command in CVS/SVN.  One of my users didn't ask, and I later found out that he
had been doing this:

$ git pull ;# rejected due to modifications in file1
$ mv file1 file1.bak
$ git checkout HEAD file1
$ git pull ;# rejected due to modifications in file2
$ mv file2 file2.bak
$ git checkout HEAD file2
$ git pull ;# ok
<manually merge file1.bak with file1>
<manually merge file2.bak with file2>

So I think an "scm up" like command is not an unreasonable thing to want.  There
is a valid, and fairly common, use case.  There are ways to get the same result
in Git, but they're cumbersome compared to just typing "scm up".  It shouldn't
be the default, but I think a lot of users would appreciate having it.

James
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]