unpack_trees: group error messages by type

When an error is encountered, it calls add_rejected_file() which either
- directly displays the error message and stops if in plumbing mode
  (i.e. if show_all_errors is not initialized at 1)
- or stores it so that it will be displayed at the end with display_error_msgs(),

Storing the files by error type permits to have a list of files for
which there is the same error instead of having a serie of almost
identical errors.

As each bind_overlap error combines a file and an old file, a list cannot be
done, therefore, theses errors are not stored but directly displayed.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthieu Moy
2010-08-11 10:38:07 +02:00
committed by Junio C Hamano
parent 08402b0409
commit e6c111b4c0
11 changed files with 123 additions and 17 deletions

View File

@ -22,6 +22,11 @@ enum unpack_trees_error_types {
NB_UNPACK_TREES_ERROR_TYPES
};
struct rejected_paths_list {
char *path;
struct rejected_paths_list *next;
};
struct unpack_trees_options {
unsigned int reset,
merge,
@ -36,12 +41,18 @@ struct unpack_trees_options {
diff_index_cached,
debug_unpack,
skip_sparse_checkout,
gently;
gently,
show_all_errors;
const char *prefix;
int cache_bottom;
struct dir_struct *dir;
merge_fn_t fn;
const char *msgs[NB_UNPACK_TREES_ERROR_TYPES];
/*
* Store error messages in an array, each case
* corresponding to a error message type
*/
struct rejected_paths_list *unpack_rejects[NB_UNPACK_TREES_ERROR_TYPES];
int head_idx;
int merge_size;