From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: "Richard Hartmann" <richih.mailinglist@gmail.com>,
"Shawn O. Pearce" <spearce@spearce.org>,
"Miklos Vajna" <vmiklos@frugalware.org>,
git@vger.kernel.org
Subject: Re: commiting while the current version is in conflict
Date: Fri, 17 Oct 2008 02:36:28 -0700 [thread overview]
Message-ID: <7vabd3mulf.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <m3d4hzk2du.fsf@localhost.localdomain> (Jakub Narebski's message of "Fri, 17 Oct 2008 02:16:35 -0700 (PDT)")
Jakub Narebski <jnareb@gmail.com> writes:
> From time to time somebody proposes to add a command which is used
> only to say that given conflict got resolved, i.e. yet another
> porcelain "around" git-update-index plumbing (in addition to git-add,
> git-mv and git-rm). One of problems is how to call it: git-resolve,
> git-resolved, git-mark-resolved?
>
> BTW. while I usually use "git commit -a", when comitting merge commit
> I usually use explicit "git add" together "git commit" (without '-a').
There are three things to keep in mind while thinking about this:
* "git add" _always_ is to mark "this path now is in a good shape and is
ready to be committed", whether you are doing a conflict resolution of
a merge or making a normal commit.
* you cannot partially commit a merge, as the resulting tree won't be a
proper merge (i.e. the change from either parents do not describe what
happened).
* during a conflicted merge, cleanly merged paths are already staged in
the index.
Which means that the only paths you would "git add" during a conflicted
merge are the paths you resolved (unless you are creating an evil merge),
and there is no point having a separate "git resolved" -- such a command
will be nothing but an alias to "git add" anyway.
We could add a training wheel mode to "git commit -a" (or "git add -u")
that warns about unmerged paths and asks confirmation, but I suspect that
it would really annoy people who used git for more than 2 weeks if we made
it the default, and on the other hand if it is not the default, it would
not help new people that much. It is nice to try to help new people from
shooting themselves in the foot, but we need to draw a line somewhere so
that we do not hurt people by being obnoxious. After all, even these new
people will graduate from the "new" status soon. My gut feeling is that
helping "oh, I staged the file that I wasn't ready to commit" is on the
other side of that line, especially since the example pre-commit hook
safety is easily available. If somebody wants to add a pre-add hook that
is run by "git add" Porcelain (but never by "update-index"), that would
add the safety net, too.
next prev parent reply other threads:[~2008-10-17 9:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
-- 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
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=7vabd3mulf.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=richih.mailinglist@gmail.com \
--cc=spearce@spearce.org \
--cc=vmiklos@frugalware.org \
/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).