git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Better error messages for checkout and merge.
@ 2010-08-09 14:19 Matthieu Moy
  2010-08-09 14:19 ` [PATCH 1/5] Turn unpack_trees_options.msgs into an array + enum Matthieu Moy
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Matthieu Moy @ 2010-08-09 14:19 UTC (permalink / raw)
  To: git, gitster; +Cc: Diane Gasselin, Matthieu Moy

This is a resurection of an old patch serie by Diane Gasselin:

http://thread.gmane.org/gmane.comp.version-control.git/149173/focus=149186

In short, when you have several untracked files that conflict with a
merge or checkout, Git currently reports just the first. After this
patch serie, it reports things like:

error: Your local changes to the following files would be overwritten by checkout:
	rep/two
	rep/one
Please, commit your changes or stash them before you can switch branches.

most of the job is done by "unpack_trees: group error messages by type",
but this needed a bit of preparation to be implementable cleanly.

Compared to previous version, there are many small cleanups, and:

* unpack_trees_options was a struct, it's now an array. This makes the
  code much cleaner whenever one tries to do clever things with it.
  That's patch "Turn unpack_trees_options.msgs into an array + enum".

* A message was previously a type + an action ("removed" or
  "overwritten"). The type now encompasses the action. This duplicates
  a few lines in the declaration of the error messages, but again
  makes the rest of the code much simpler. That's patch
  "merge-recursive: distinguish "removed" and "overwritten" messages"

* The info on whether traverse_trees should stop at the first error
  was stored in info->data, with a very fragile cast to
  (unpack_trees_options *). I added one more field in the info
  structure to get rid of this cast.

Diane Gasselin (2):
  merge-recursive: porcelain messages for checkout
  t7609: test merge and checkout error messages

Matthieu Moy (3):
  Turn unpack_trees_options.msgs into an array + enum
  merge-recursive: distinguish "removed" and "overwritten" messages
  unpack_trees: group error messages by type

 Documentation/technical/api-tree-walking.txt |    2 +
 builtin/checkout.c                           |    3 +-
 builtin/merge.c                              |    3 +-
 merge-recursive.c                            |   62 +++++++----
 merge-recursive.h                            |    7 +-
 t/t3030-merge-recursive.sh                   |    2 +-
 t/t3400-rebase.sh                            |    3 +-
 t/t3404-rebase-interactive.sh                |    3 +-
 t/t7609-merge-co-error-msgs.sh               |  125 ++++++++++++++++++++++
 tree-walk.c                                  |   11 ++-
 tree-walk.h                                  |    1 +
 unpack-trees.c                               |  148 ++++++++++++++++++++------
 unpack-trees.h                               |   34 ++++--
 13 files changed, 332 insertions(+), 72 deletions(-)
 create mode 100755 t/t7609-merge-co-error-msgs.sh

-- 
1.7.2.1.52.g95e25.dirty

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/5 v2] unpack_trees: nicer error messages
@ 2010-06-15 12:22 Diane Gasselin
  2010-06-15 12:22 ` [PATCH 1/5 v2] merge-recursive: porcelain messages for checkout Diane Gasselin
  0 siblings, 1 reply; 18+ messages in thread
From: Diane Gasselin @ 2010-06-15 12:22 UTC (permalink / raw)
  To: git; +Cc: Diane Gasselin

This patch serie aims at grouping porcerlain merge and checkout 
errors messages by type if possible, listing all the file concerned
by the error type.
It also adds porcelain messages for checkout.

It was first introduced in the thread:
http://mid.gmane.org/7v63277f92.fsf@alter.siamese.dyndns.org

Diane Gasselin (5):
  merge-recursive: update merge porcelain messages for checkout
  unpack_trees: group errors by type
  unpack_trees_options: update porcelain messages
  tests: update porcelain expected message
  t7609: test merge and checkout error messages

 builtin/checkout.c             |    4 +-
 builtin/merge.c                |    3 +-
 merge-recursive.c              |   48 ++++++++++------
 merge-recursive.h              |    6 +-
 t/t3030-merge-recursive.sh     |    2 +-
 t/t3400-rebase.sh              |    2 +-
 t/t7609-merge-co-error-msgs.sh |  125 ++++++++++++++++++++++++++++++++++++++++
 tree-walk.c                    |   11 +++-
 unpack-trees.c                 |  119 +++++++++++++++++++++++++++++++++++---
 unpack-trees.h                 |   31 ++++++++++-
 10 files changed, 316 insertions(+), 35 deletions(-)
 create mode 100755 t/t7609-merge-co-error-msgs.sh

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

end of thread, other threads:[~2010-08-11  8:44 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 14:19 [PATCH 0/5] Better error messages for checkout and merge Matthieu Moy
2010-08-09 14:19 ` [PATCH 1/5] Turn unpack_trees_options.msgs into an array + enum Matthieu Moy
2010-08-09 19:47   ` Junio C Hamano
2010-08-09 20:49     ` Matthieu Moy
2010-08-11  8:38       ` [PATCH 1/5 v2] " Matthieu Moy
2010-08-11  8:38       ` [PATCH 2/5 v2] merge-recursive: porcelain messages for checkout Matthieu Moy
2010-08-11  8:38       ` [PATCH 3/5 v2] merge-recursive: distinguish "removed" and "overwritten" messages Matthieu Moy
2010-08-11  8:38       ` [PATCH 4/5 v2] unpack_trees: group error messages by type Matthieu Moy
2010-08-11  8:38       ` [PATCH 5/5 v2] t7609: test merge and checkout error messages Matthieu Moy
2010-08-09 14:19 ` [PATCH 2/5] merge-recursive: porcelain messages for checkout Matthieu Moy
2010-08-09 19:58   ` Junio C Hamano
2010-08-09 20:52     ` Matthieu Moy
2010-08-09 21:15       ` Ævar Arnfjörð Bjarmason
2010-08-09 14:20 ` [PATCH 3/5] merge-recursive: distinguish "removed" and "overwritten" messages Matthieu Moy
2010-08-09 14:20 ` [PATCH 4/5] unpack_trees: group error messages by type Matthieu Moy
2010-08-09 14:20 ` [PATCH 5/5] t7609: test merge and checkout error messages Matthieu Moy
  -- strict thread matches above, loose matches on Subject: below --
2010-06-15 12:22 [PATCH 0/5 v2] unpack_trees: nicer " Diane Gasselin
2010-06-15 12:22 ` [PATCH 1/5 v2] merge-recursive: porcelain messages for checkout Diane Gasselin
2010-06-15 12:22   ` [PATCH 2/5 v2] unpack_trees: group errors by type Diane Gasselin
2010-06-15 12:22     ` [PATCH 3/5 v2] unpack_trees_options: update porcelain messages Diane Gasselin
2010-06-15 12:22       ` [PATCH 4/5 v2] tests: update porcelain expected message Diane Gasselin
2010-06-15 12:22         ` [PATCH 5/5 v2] t7609: test merge and checkout error messages Diane Gasselin
2010-06-15 13:09           ` Matthieu Moy

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