git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* merging confusion and question
@ 2012-08-08  0:25 Rich Pixley
  2012-08-08  1:43 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Rich Pixley @ 2012-08-08  0:25 UTC (permalink / raw)
  To: git@vger.kernel.org

I'm confused.

What is the intended work flow here?  Ie, aside from trashing my 
repository and starting over, what does one do to recover?

rich@cobra> git clone /home/rich/repos/webos webos
Cloning into 'webos'...
done.
rich@cobra> cd webos
rich@cobra> git remote add central git@github.com:openwebos/webos.git
rich@cobra> git co master
Already on 'master'
rich@cobra> git pull central master
X11 forwarding request failed on channel 0
remote: Counting objects: 22, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 21 (delta 12), reused 11 (delta 2)
Unpacking objects: 100% (21/21), done.
 From github.com:openwebos/webos
  * branch            master     -> FETCH_HEAD
warning: Failed to merge submodule meta-webos (not checked out)
Auto-merging meta-webos
CONFLICT (submodule): Merge conflict in meta-webos
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.
rich@cobra> git commit -a
error: unable to index file meta-webos
fatal: updating files failed
rich@cobra> git add meta-webos
error: unable to index file meta-webos
fatal: updating files failed
rich@cobra> git rm meta-webos
meta-webos: needs merge
rm 'meta-webos'
fatal: git rm: 'meta-webos': Is a directory
rich@cobra> git merge meta-webos
error: 'merge' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: Exiting because of an unresolved conflict.

--rich

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: merging confusion and question
  2012-08-08  0:25 merging confusion and question Rich Pixley
@ 2012-08-08  1:43 ` Junio C Hamano
  2012-08-08 17:50   ` Rich Pixley
  2012-08-10 19:37   ` Phil Hord
  0 siblings, 2 replies; 5+ messages in thread
From: Junio C Hamano @ 2012-08-08  1:43 UTC (permalink / raw)
  To: Rich Pixley; +Cc: git@vger.kernel.org

Rich Pixley <rich.pixley@palm.com> writes:

> I'm confused.
>
> What is the intended work flow here?  Ie, aside from trashing my
> repository and starting over, what does one do to recover?
>
> rich@cobra> git clone /home/rich/repos/webos webos
> Cloning into 'webos'...
> done.
> rich@cobra> cd webos
> rich@cobra> git remote add central git@github.com:openwebos/webos.git
> rich@cobra> git co master
> Already on 'master'
> rich@cobra> git pull central master
> X11 forwarding request failed on channel 0
> remote: Counting objects: 22, done.
> remote: Compressing objects: 100% (19/19), done.
> remote: Total 21 (delta 12), reused 11 (delta 2)
> Unpacking objects: 100% (21/21), done.
> From github.com:openwebos/webos
>  * branch            master     -> FETCH_HEAD
> warning: Failed to merge submodule meta-webos (not checked out)
> Auto-merging meta-webos
> CONFLICT (submodule): Merge conflict in meta-webos
> Auto-merging README.md
> Automatic merge failed; fix conflicts and then commit the result.
> rich@cobra> git commit -a

Why isn't there any "fix conflicts and then" step between this line
and the friendly insn message on the previous line?

> error: unable to index file meta-webos
> fatal: updating files failed
> rich@cobra> git add meta-webos
> error: unable to index file meta-webos
> fatal: updating files failed
> rich@cobra> git rm meta-webos
> meta-webos: needs merge
> rm 'meta-webos'
> fatal: git rm: 'meta-webos': Is a directory
> rich@cobra> git merge meta-webos
> error: 'merge' is not possible because you have unmerged files.
> hint: Fix them up in the work tree,
> hint: and then use 'git add/rm <file>' as
> hint: appropriate to mark resolution and make a commit,
> hint: or use 'git commit -a'.
> fatal: Exiting because of an unresolved conflict.

If you are not interested in mucking with meta-webos with this
merge, you would resolve meta-webos by taking either your (i.e. the
one that came from /home/rich/repos/webos) version or their
(i.e. the one that came from openwebos/webos.git) version.  Go back
to the state before "git pull central master" with "reset --hard",
init and update webos submodule, try the "pull" again and then "git
add webos" to resolve to your version, perhaps?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: merging confusion and question
  2012-08-08  1:43 ` Junio C Hamano
@ 2012-08-08 17:50   ` Rich Pixley
  2012-08-10 19:37   ` Phil Hord
  1 sibling, 0 replies; 5+ messages in thread
From: Rich Pixley @ 2012-08-08 17:50 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org

Thank you.

I think the work flow here needs some work, but reset --hard gets me 
running again.  That should probably be mentioned in the error message.

--rich

On 8/7/12 18:43 , Junio C Hamano wrote:
> Rich Pixley <rich.pixley@palm.com> writes:
>
>> I'm confused.
>>
>> What is the intended work flow here?  Ie, aside from trashing my
>> repository and starting over, what does one do to recover?
>>
>> rich@cobra> git clone /home/rich/repos/webos webos
>> Cloning into 'webos'...
>> done.
>> rich@cobra> cd webos
>> rich@cobra> git remote add central git@github.com:openwebos/webos.git
>> rich@cobra> git co master
>> Already on 'master'
>> rich@cobra> git pull central master
>> X11 forwarding request failed on channel 0
>> remote: Counting objects: 22, done.
>> remote: Compressing objects: 100% (19/19), done.
>> remote: Total 21 (delta 12), reused 11 (delta 2)
>> Unpacking objects: 100% (21/21), done.
>>  From github.com:openwebos/webos
>>   * branch            master     -> FETCH_HEAD
>> warning: Failed to merge submodule meta-webos (not checked out)
>> Auto-merging meta-webos
>> CONFLICT (submodule): Merge conflict in meta-webos
>> Auto-merging README.md
>> Automatic merge failed; fix conflicts and then commit the result.
>> rich@cobra> git commit -a
> Why isn't there any "fix conflicts and then" step between this line
> and the friendly insn message on the previous line?
>
>> error: unable to index file meta-webos
>> fatal: updating files failed
>> rich@cobra> git add meta-webos
>> error: unable to index file meta-webos
>> fatal: updating files failed
>> rich@cobra> git rm meta-webos
>> meta-webos: needs merge
>> rm 'meta-webos'
>> fatal: git rm: 'meta-webos': Is a directory
>> rich@cobra> git merge meta-webos
>> error: 'merge' is not possible because you have unmerged files.
>> hint: Fix them up in the work tree,
>> hint: and then use 'git add/rm <file>' as
>> hint: appropriate to mark resolution and make a commit,
>> hint: or use 'git commit -a'.
>> fatal: Exiting because of an unresolved conflict.
> If you are not interested in mucking with meta-webos with this
> merge, you would resolve meta-webos by taking either your (i.e. the
> one that came from /home/rich/repos/webos) version or their
> (i.e. the one that came from openwebos/webos.git) version.  Go back
> to the state before "git pull central master" with "reset --hard",
> init and update webos submodule, try the "pull" again and then "git
> add webos" to resolve to your version, perhaps?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: merging confusion and question
  2012-08-08  1:43 ` Junio C Hamano
  2012-08-08 17:50   ` Rich Pixley
@ 2012-08-10 19:37   ` Phil Hord
  2012-08-10 20:16     ` Junio C Hamano
  1 sibling, 1 reply; 5+ messages in thread
From: Phil Hord @ 2012-08-10 19:37 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Rich Pixley, git@vger.kernel.org

On Tue, Aug 7, 2012 at 9:43 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Rich Pixley <rich.pixley@palm.com> writes:
>
>> I'm confused.
>>
>> What is the intended work flow here?  Ie, aside from trashing my
>> repository and starting over, what does one do to recover?
>>
>> rich@cobra> git clone /home/rich/repos/webos webos
>> Cloning into 'webos'...
>> done.
>> rich@cobra> cd webos
>> rich@cobra> git remote add central git@github.com:openwebos/webos.git
>> rich@cobra> git co master
>> Already on 'master'
>> rich@cobra> git pull central master
>> X11 forwarding request failed on channel 0
>> remote: Counting objects: 22, done.
>> remote: Compressing objects: 100% (19/19), done.
>> remote: Total 21 (delta 12), reused 11 (delta 2)
>> Unpacking objects: 100% (21/21), done.
>> From github.com:openwebos/webos
>>  * branch            master     -> FETCH_HEAD
>> warning: Failed to merge submodule meta-webos (not checked out)
>> Auto-merging meta-webos
>> CONFLICT (submodule): Merge conflict in meta-webos
>> Auto-merging README.md
>> Automatic merge failed; fix conflicts and then commit the result.
>> rich@cobra> git commit -a
>
> Why isn't there any "fix conflicts and then" step between this line
> and the friendly insn message on the previous line?

I think I know the answer.  I remember it from my newbie days.

The reason is that "fix conflicts" is confusing to new users. The new
user didn't really want to merge here, perhaps, which is why there
were so many conflicts.  Git "helpfully" points out each one of the
conflicts, but he doesn't explain what happened as a result (change
markers in the file, etc.).  For the newbie, this is not intuitive;
the barrage of conflict details is intimidating.

"Fix conflicts"?  If I do not know how the conflicts are represented
yet, I also do not know how to fix them.

"Commit the result"?  Result of what?  Commit how?

Adding insult to injury, newbies can find no obvious way to "undo and
try again."  Each command they think should move forward or "do over"
is met with "cannot do that. conflicts exist.  fix this mess and try
again."

Imagine your mom on the web for the first time encountering a "404".
Now imagine that once this happens her browser refuses to work
insisting she "fix the web" first.

I do not know a better description which would not rub the gurus the
wrong way.  When I try to think of one, the hint always involves
something called "git undo".  So I guess the status quo is good for
now, which is "google git merge conflict"

I agree that 'git reset --hard' should be mentioned in the hint for
newbies, but this conflicts with my desire to avoid giving chainsaws
to toddlers.

Phil

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: merging confusion and question
  2012-08-10 19:37   ` Phil Hord
@ 2012-08-10 20:16     ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2012-08-10 20:16 UTC (permalink / raw)
  To: Phil Hord; +Cc: Rich Pixley, git@vger.kernel.org

Phil Hord <phil.hord@gmail.com> writes:

> I agree that 'git reset --hard' should be mentioned in the hint for
> newbies, but this conflicts with my desire to avoid giving chainsaws
> to toddlers.

Exactly.  So what are you suggesting?

Perhaps force the user to go through a series of quiz when "git
merge" was run by the user for the first time to make sure she at
least read the sections on merges and conflict resolutions in the
documentation to understand the fundamentals, and refuse to proceed
until the user passes?

I personally do not see a good way out.  Even telling new users not
to do merges, rebases, or resets but to only build a straight linear
history is not a fix, as the user will never gain the necessary
understanding by doing only limited and simple things.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-10 20:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08  0:25 merging confusion and question Rich Pixley
2012-08-08  1:43 ` Junio C Hamano
2012-08-08 17:50   ` Rich Pixley
2012-08-10 19:37   ` Phil Hord
2012-08-10 20:16     ` Junio C Hamano

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).