]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/cat-file'
authorJunio C Hamano <gitster@pobox.com>
Sat, 5 Feb 2022 17:42:31 +0000 (09:42 -0800)
committerJunio C Hamano <gitster@pobox.com>
Sat, 5 Feb 2022 17:42:31 +0000 (09:42 -0800)
Assorted updates to "git cat-file", especially "-h".

* ab/cat-file:
  cat-file: s/_/-/ in typo'd usage_msg_optf() message
  cat-file: don't whitespace-pad "(...)" in SYNOPSIS and usage output
  cat-file: use GET_OID_ONLY_TO_DIE in --(textconv|filters)
  object-name.c: don't have GET_OID_ONLY_TO_DIE imply *_QUIETLY
  cat-file: correct and improve usage information
  cat-file: fix remaining usage bugs
  cat-file: make --batch-all-objects a CMDMODE
  cat-file: move "usage" variable to cmd_cat_file()
  cat-file docs: fix SYNOPSIS and "-h" output
  parse-options API: add a usage_msg_optf()
  cat-file tests: test messaging on bad objects/paths
  cat-file tests: test bad usage

1  2 
builtin/stash.c
cache.h
parse-options.c
parse-options.h
t/t1006-cat-file.sh

diff --cc builtin/stash.c
Simple merge
diff --cc cache.h
Simple merge
diff --cc parse-options.c
index a8283037be966596184862aa358bff6fd37194f3,5a319dda7d5466d1f93b64d256bbd889938756ca..2437ad3bcdd5b6ff06bf3f46fb00a1106958cca3
@@@ -1076,6 -1075,19 +1076,19 @@@ void NORETURN usage_msg_opt(const char 
                   const char * const *usagestr,
                   const struct option *options)
  {
 -      fprintf(stderr, "fatal: %s\n\n", msg);
 +      die_message("%s\n", msg); /* The extra \n is intentional */
        usage_with_options(usagestr, options);
  }
+ void NORETURN usage_msg_optf(const char * const fmt,
+                            const char * const *usagestr,
+                            const struct option *options, ...)
+ {
+       struct strbuf msg = STRBUF_INIT;
+       va_list ap;
+       va_start(ap, options);
+       strbuf_vaddf(&msg, fmt, ap);
+       va_end(ap);
+       usage_msg_opt(msg.buf, usagestr, options);
+ }
diff --cc parse-options.h
Simple merge
Simple merge