git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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; 14+ 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] 14+ messages in thread
* Re: [PATCH 1/5] Turn unpack_trees_options.msgs into an array + enum
@ 2010-08-09 20:49 Matthieu Moy
  2010-08-11  8:38 ` [PATCH 5/5 v2] t7609: test merge and checkout error messages Matthieu Moy
  0 siblings, 1 reply; 14+ messages in thread
From: Matthieu Moy @ 2010-08-09 20:49 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Diane Gasselin

Junio C Hamano <gitster@pobox.com> writes:

> Matthieu Moy <Matthieu.Moy@imag.fr> writes:
>
>> The list of error messages was introduced as a structure, but an array
>> indexed over an enum is more flexible, since it allows one to store a
>> type of error message (index in the array) in a variable.
>
> Hmm, the only example of the advantage "enum used as array index" offers
> that I can think of off the top of my head is that you can more easily
> iterate over it.

The portion of my message you cite give another: the ability to store
the index easily in a variable (or to pass it as argument to a
function). With a struct, you can easily pass field name to a macro,
but not to a function.

The other is that you can have multiple arrays indexed over the same
enum, which is what we do later: we'll have to manage an array of list
of rejected paths, with one list per error kind.

(we'll also have to iterate over this second array)

The previous version of the patch serie was using both a struct and an
enum + array, and I wanted to get rid of that.

> If you are to change them to enum, I would actually suggest renaming them
> a bit more to make them stand out.  Perhaps spell them all in caps,
> perhaps have them share the same short prefix (UTEM_ - unpack trees error
> messages), etc.

I'd say just "ERROR_*" (UTEM seems hard to read, and won't be used
often enough for people to remember it), but I'm fine with all caps +
prefix, yes. A quick grep shows this is how the rest of Git does.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

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

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

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-15 12:22 [PATCH 0/5 v2] unpack_trees: nicer error messages 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
2010-06-15 13:05       ` [PATCH 3/5 v2] unpack_trees_options: update porcelain messages Matthieu Moy
2010-06-15 12:58     ` [PATCH 2/5 v2] unpack_trees: group errors by type Matthieu Moy
2010-06-15 13:15       ` Diane Gasselin
2010-06-15 13:28         ` Matthieu Moy
2010-06-15 13:40           ` Diane Gasselin
2010-06-15 12:36   ` [PATCH 1/5 v2] merge-recursive: porcelain messages for checkout Matthieu Moy
  -- strict thread matches above, loose matches on Subject: below --
2010-08-09 20:49 [PATCH 1/5] Turn unpack_trees_options.msgs into an array + enum Matthieu Moy
2010-08-11  8:38 ` [PATCH 5/5 v2] t7609: test merge and checkout error messages 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).