git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: John Dlugosz <JDlugosz@TradeStation.com>, git@vger.kernel.org
Subject: Re: Files different for me
Date: Wed, 25 Feb 2009 11:12:47 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0902251106070.3111@localhost.localdomain> (raw)
In-Reply-To: <7v4oyi2vvf.fsf@gitster.siamese.dyndns.org>



On Wed, 25 Feb 2009, Junio C Hamano wrote:
>
> I've been repeating the above to new people to save you time, but recently
> I noticed one thing.
> 
> The handling of a case where a pull decides to go ahead (because it does
> not have to touch the Makefile you have your codename updates in) but does
> not complete with real conflicts, is not as graceful as the other two
> cases (merge refusing to run at all without touching anything, or merge
> completes cleanly and makes a commit).

I agree (although your phrasing was confusing - by "does not complete with 
real conflicts" you made it sound like there were no real conflicts, but 
you must have meant "does not actually finish the merge commit _due_ to 
real conflicts").

That case is one large part of why I wanted to have that "git reset 
--merge" behavior - because it's a good way to get back to the "pre-merge 
with dirty state" situation. Although I have to admit that I don't think 
I've had that happen since the feature got merged ;)

> You will be left with:
> 
>  - Paths that have local changes (index matches HEAD but work tree does
>    not match the index --- like your Makefile);
> 
>  - Paths cleanly merged (index and HEAD are different but work tree
>    already matches the index);
> 
>  - Unmerged paths (index has higher stage entries with <<</===/>>> files
>    in the work tree);

Yes. The good news is that for people who know what they are doing, this 
is all unambiguous. Clean merges will be up-to-date in the index, unmgered 
paths will be marked as such in the index, and your own _real_ dirty state 
will be unambioguously dirty in the working tree.

But I do agree that if you don't know what's up, you now are an in a 
really good position for screwing up, and (for example) resolving the 
merge conflict and then incorrectly committing your own unrelated changes 
with the merge.

> You, I and experienced users know what to do.  Deal *only* with the last
> kind, mark them with "git add" after you are done with each of them, and
> make sure you do not say "-a" when committing the result, to exclude the
> first kind from the merge result.
> 
> I've been wondering if we can make this safer for others.

You're right. We could decide to have a mode (maybe default to it, so that 
people like me can just use a config option to enable "expert" mode) that
simply refuses to do the merge if it doesn't succeed cleanly if there were 
dirty files in the tree.

			Linus

  reply	other threads:[~2009-02-25 19:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 16:11 Files different for me John Dlugosz
     [not found] ` <16946e800902250840o677f8708x7c0bf8980e004b91@mail.gmail.com>
2009-02-25 16:42   ` Feanil Patel
2009-02-25 17:05 ` Brian Gernhardt
2009-02-25 18:02   ` John Dlugosz
2009-02-25 18:38     ` Brian Gernhardt
2009-02-25 19:01       ` John Dlugosz
2009-02-25 18:44     ` Matthieu Moy
2009-02-25 17:55 ` Junio C Hamano
2009-02-25 18:04 ` Linus Torvalds
2009-02-25 18:51   ` Junio C Hamano
2009-02-25 19:12     ` Linus Torvalds [this message]
2009-02-25 20:06       ` Junio C Hamano
2009-02-25 20:14         ` Linus Torvalds
2009-02-25 19:16     ` Jay Soffian
2009-02-25 19:38       ` John Dlugosz
2009-02-25 19:23     ` John Dlugosz
2009-02-25 20:04       ` Junio C Hamano

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=alpine.LFD.2.00.0902251106070.3111@localhost.localdomain \
    --to=torvalds@linux-foundation.org \
    --cc=JDlugosz@TradeStation.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).