Files
git/Documentation
Matthieu Moy d38a30df7d Be more user-friendly when refusing to do something because of conflict.
Various commands refuse to run in the presence of conflicts (commit,
merge, pull, cherry-pick/revert). They all used to provide rough, and
inconsistant error messages.

A new variable advice.resolveconflict is introduced, and allows more
verbose messages, pointing the user to the appropriate solution.

For commit, the error message used to look like this:

$ git commit
foo.txt: needs merge
foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169)
foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030)
foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4)
error: Error building trees

The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN
option to make the output more consistant with the other porcelain
commands, and catch the error in return, to stop with a clean error
message. The next lines were displayed by a call to cache_tree_update(),
which is not reached anymore if we noticed the conflict.

The new output looks like:

U       foo.txt
fatal: 'commit' is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>' as
appropriate to mark resolution and make a commit, or use 'git commit -a'.

Pull is slightly modified to abort immediately if $GIT_DIR/MERGE_HEAD
exists instead of waiting for merge to complain.

The behavior of merge and the test-case are slightly modified to reflect
the usual flow: start with conflicts, fix them, and afterwards get rid of
MERGE_HEAD, with different error messages at each stage.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-01-12 13:17:08 -08:00
..
2009-10-01 08:21:35 -04:00
2009-12-19 23:20:16 -08:00
2009-04-06 00:27:09 -07:00
2009-11-30 14:43:26 -08:00
2009-11-23 00:03:15 -08:00
2009-07-22 21:54:54 -07:00
2009-04-18 14:45:59 -07:00
2009-08-12 16:36:04 -07:00
2009-12-10 12:21:40 -08:00
2009-11-13 12:20:47 -08:00
2009-12-23 12:23:11 -08:00
2009-12-01 12:47:04 -08:00
2009-12-10 16:20:59 -08:00
2009-12-05 11:39:13 -08:00
2009-11-30 14:44:22 -08:00
2009-05-03 15:29:31 -07:00
2009-03-15 13:05:05 -07:00
2009-04-02 12:34:16 -07:00
2009-04-12 15:57:58 -07:00
2009-04-19 17:34:26 -07:00
2009-05-03 16:54:14 -07:00
2009-03-03 23:37:19 -08:00
2009-05-12 22:30:29 -07:00
2009-06-03 22:47:48 -07:00
2009-06-21 21:15:50 -07:00
2009-07-28 23:59:30 -07:00
2009-05-06 18:16:40 -07:00
2009-08-21 20:16:10 -07:00
2009-08-29 14:31:01 -07:00
2009-09-13 01:28:13 -07:00
2009-09-16 14:53:26 -07:00
2009-07-29 00:32:42 -07:00
2009-10-16 23:57:19 -07:00
2009-10-25 18:37:56 -07:00
2009-11-16 00:05:12 -08:00
2009-12-02 10:29:00 -08:00
2009-12-05 11:08:35 -08:00
2009-12-10 15:42:30 -08:00
2009-12-16 12:45:25 -08:00
2009-10-10 00:05:19 -07:00
2009-12-23 12:23:11 -08:00