git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/3] fix diff-parseopt regressions

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
May 29, 2019, 09:11 UTC
Message-ID
<20190529091116.21898-1-pclouds@gmail.com>
In-Reply-To
<20190524092442.701-1-pclouds@gmail.com>

v2 reduces diff noise. My C is rusty (and probably holey too). For some reason I remember "unsigned" is equivalent to "unsigned short", not "unsigned int".

Nguyễn Thái Ngọc Duy (3):
  diff-parseopt: correct variable types that are used by parseopt
  diff-parseopt: restore -U (no argument) behavior
  parse-options: check empty value in OPT_INTEGER and OPT_ABBREV
 diff.c                                    | 10 ++++---
 diff.h                                    |  2 +-
 parse-options-cb.c                        |  3 +++
 parse-options.c                           |  3 +++
 t/t4013-diff-various.sh                   |  2 ++
 t/t4013/diff.diff_-U1_initial..side (new) | 29 ++++++++++++++++++++
 t/t4013/diff.diff_-U2_initial..side (new) | 31 ++++++++++++++++++++++
 t/t4013/diff.diff_-U_initial..side (new)  | 32 +++++++++++++++++++++++
 8 files changed, 107 insertions(+), 5 deletions(-)
 create mode 100644 t/t4013/diff.diff_-U1_initial..side
 create mode 100644 t/t4013/diff.diff_-U2_initial..side
 create mode 100644 t/t4013/diff.diff_-U_initial..side
Interdiff dựa trên v1:
diff --git a/diff.h b/diff.h
index 4527daf6b7..d5e44baa96 100644
--- a/diff.h
+++ b/diff.h
@@ -65,39 +65,39 @@ typedef struct strbuf *(*diff_prefix_fn_t)(struct diff_options *opt, void *data)
 
 #define DIFF_FLAGS_INIT { 0 }
 struct diff_flags {
-	unsigned int recursive;
-	unsigned int tree_in_recursive;
-	unsigned int binary;
-	unsigned int text;
-	unsigned int full_index;
-	unsigned int silent_on_remove;
-	unsigned int find_copies_harder;
-	unsigned int follow_renames;
-	unsigned int rename_empty;
-	unsigned int has_changes;
-	unsigned int quick;
-	unsigned int no_index;
-	unsigned int allow_external;
-	unsigned int exit_with_status;
-	unsigned int reverse_diff;
-	unsigned int check_failed;
-	unsigned int relative_name;
-	unsigned int ignore_submodules;
-	unsigned int dirstat_cumulative;
-	unsigned int dirstat_by_file;
-	unsigned int allow_textconv;
-	unsigned int textconv_set_via_cmdline;
-	unsigned int diff_from_contents;
-	unsigned int dirty_submodules;
-	unsigned int ignore_untracked_in_submodules;
-	unsigned int ignore_dirty_submodules;
-	unsigned int override_submodule_config;
-	unsigned int dirstat_by_line;
-	unsigned int funccontext;
-	unsigned int default_follow_renames;
-	unsigned int stat_with_summary;
-	unsigned int suppress_diff_headers;
-	unsigned int dual_color_diffed_diffs;
+	unsigned recursive;
+	unsigned tree_in_recursive;
+	unsigned binary;
+	unsigned text;
+	unsigned full_index;
+	unsigned silent_on_remove;
+	unsigned find_copies_harder;
+	unsigned follow_renames;
+	unsigned rename_empty;
+	unsigned has_changes;
+	unsigned quick;
+	unsigned no_index;
+	unsigned allow_external;
+	unsigned exit_with_status;
+	unsigned reverse_diff;
+	unsigned check_failed;
+	unsigned relative_name;
+	unsigned ignore_submodules;
+	unsigned dirstat_cumulative;
+	unsigned dirstat_by_file;
+	unsigned allow_textconv;
+	unsigned textconv_set_via_cmdline;
+	unsigned diff_from_contents;
+	unsigned dirty_submodules;
+	unsigned ignore_untracked_in_submodules;
+	unsigned ignore_dirty_submodules;
+	unsigned override_submodule_config;
+	unsigned dirstat_by_line;
+	unsigned funccontext;
+	unsigned default_follow_renames;
+	unsigned stat_with_summary;
+	unsigned suppress_diff_headers;
+	unsigned dual_color_diffed_diffs;
 };
 
 static inline void diff_flags_or(struct diff_flags *a,
@@ -151,7 +151,7 @@ struct diff_options {
 	int skip_stat_unmatch;
 	int line_termination;
 	int output_format;
-	unsigned int pickaxe_opts;
+	unsigned pickaxe_opts;
 	int rename_score;
 	int rename_limit;
 	int needed_rename_limit;
-- 
2.22.0.rc0.322.g2b0371e29a
Previous: Todd ZullingerNext: Nguyễn Thái Ngọc Duy
Message 11 of 18 in “fix diff-parseopt regressions”
  1. 0/3 fix diff-parseopt regressionsNguyễn Thái Ngọc Duy, May 24, 2019
  2. 1/3 diff-parseopt: correct variable types that are used by parseoptNguyễn Thái Ngọc Duy, May 24, 2019
  3. Junio C HamanoMay 28, 2019
  4. 2/3 diff-parseopt: restore -U (no argument) behaviorNguyễn Thái Ngọc Duy, May 24, 2019
  5. 3/3 parse-options: check empty value in OPT_INTEGER and OPT_ABBREVNguyễn Thái Ngọc Duy, May 24, 2019
  6. 4/3 parse-options: make compiler check value type mismatchNguyễn Thái Ngọc Duy, May 24, 2019
  7. Todd ZullingerMay 24, 2019
  8. Todd ZullingerMay 24, 2019
  9. Duy NguyenMay 25, 2019
  10. Todd ZullingerMay 25, 2019
  11. 0/3 fix diff-parseopt regressionsNguyễn Thái Ngọc Duy, May 29, 2019
  12. 1/3 diff-parseopt: correct variable types that are used by parseoptNguyễn Thái Ngọc Duy, May 29, 2019
  13. Eric SunshineMay 29, 2019
  14. Todd ZullingerMay 29, 2019
  15. Junio C HamanoMay 29, 2019
  16. 2/3 diff-parseopt: restore -U (no argument) behaviorNguyễn Thái Ngọc Duy, May 29, 2019
  17. 3/3 parse-options: check empty value in OPT_INTEGER and OPT_ABBREVNguyễn Thái Ngọc Duy, May 29, 2019
  18. Junio C HamanoMay 29, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.