git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: commiting while the current version is in conflict
@ 2008-10-16 23:39 Junio Hamano
  2008-10-17  7:21 ` Richard Hartmann
  0 siblings, 1 reply; 17+ messages in thread
From: Junio Hamano @ 2008-10-16 23:39 UTC (permalink / raw)
  To: Richard Hartmann; +Cc: Shawn O. Pearce, Miklos Vajna, git

> Judging from the code in the pre-commit script, git does not
> keep conflict information in its metadata cache, but tries to guess
> conflicts from the file's contents/ This seems to be a strange
> thing to do, imo. What's the reason for this?

Because 

 (0) You are wrong to assume that git does not keep conflict
     information; we can tell if the index is "unmerged" to see
     if you still have unresolved conflicts;

 (1) When the index is unmerged, git-commit will stop even
     before getting to pre-commit hook, so there is no point
     for pre-commit hook to check if the index is unmerged;

 (2) pre-commit hook is a last ditch effort to help ignorant
     users who have already done "git add" without thinking and
     lost the "unmerged" state.  It has to look at and guess at
     the contents for that.

^ permalink raw reply	[flat|nested] 17+ messages in thread
* commiting while the current version is in conflict
@ 2008-10-16 22:10 Richard Hartmann
  2008-10-16 22:48 ` Miklos Vajna
  2008-10-16 23:42 ` Jakub Narebski
  0 siblings, 2 replies; 17+ messages in thread
From: Richard Hartmann @ 2008-10-16 22:10 UTC (permalink / raw)
  To: git

Hi all,

I fooled around with git a liitle bit and noticed something
rather strange. I merged two branches, creating a conflict
on purpose. When I then did a

 git commit -a

all changes were submitted. Of course, I now have a
file with the conflict markers inlined in my repository. Not
a good thing, imo. Is there a way to make git block all
conflicting versions?

Also, I would be interested in the design decissions
behind the current behaviour. Any pointers?


Thanks,
Richard

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

end of thread, other threads:[~2008-10-17  9:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-16 23:39 commiting while the current version is in conflict Junio Hamano
2008-10-17  7:21 ` Richard Hartmann
2008-10-17  8:37   ` Junio C Hamano
2008-10-17  9:32     ` Richard Hartmann
2008-10-17  9:16   ` Jakub Narebski
2008-10-17  9:35     ` Richard Hartmann
2008-10-17  9:36     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2008-10-16 22:10 Richard Hartmann
2008-10-16 22:48 ` Miklos Vajna
2008-10-16 23:00   ` Shawn O. Pearce
2008-10-16 23:26     ` Richard Hartmann
2008-10-17  1:16       ` Avery Pennarun
2008-10-16 23:07   ` Richard Hartmann
2008-10-16 23:23     ` Shawn O. Pearce
2008-10-16 23:31       ` Richard Hartmann
2008-10-16 23:42 ` Jakub Narebski
2008-10-17  7:25   ` Richard Hartmann

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