From dab0d4108d7b45905a12ec6cea2cfc20ea8eabef Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Mon, 7 Feb 2011 02:17:27 -0600 Subject: [PATCH 01/11] correct type of EMPTY_TREE_SHA1_BIN Functions such as hashcmp that expect a binary SHA-1 value take parameters of type "unsigned char *" to avoid accepting a textual SHA-1 passed by mistake. Unfortunately, this means passing the string literal EMPTY_TREE_SHA1_BIN requires an ugly cast. Tweak the definition of EMPTY_TREE_SHA1_BIN to produce a value of more convenient type. In the future the definition might change to extern const unsigned char empty_tree_sha1_bin[20]; #define EMPTY_TREE_SHA1_BIN empty_tree_sha1_bin Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- builtin/checkout.c | 2 +- cache.h | 4 +++- notes-merge.c | 2 +- sha1_file.c | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 757f9a08dd..cd7f56e6c4 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -404,7 +404,7 @@ static int merge_working_tree(struct checkout_opts *opts, topts.dir->exclude_per_dir = ".gitignore"; tree = parse_tree_indirect(old->commit ? old->commit->object.sha1 : - (unsigned char *)EMPTY_TREE_SHA1_BIN); + EMPTY_TREE_SHA1_BIN); init_tree_desc(&trees[0], tree->buffer, tree->size); tree = parse_tree_indirect(new->commit->object.sha1); init_tree_desc(&trees[1], tree->buffer, tree->size); diff --git a/cache.h b/cache.h index d83d68c859..3abf8950bd 100644 --- a/cache.h +++ b/cache.h @@ -676,9 +676,11 @@ static inline void hashclr(unsigned char *hash) #define EMPTY_TREE_SHA1_HEX \ "4b825dc642cb6eb9a060e54bf8d69288fbee4904" -#define EMPTY_TREE_SHA1_BIN \ +#define EMPTY_TREE_SHA1_BIN_LITERAL \ "\x4b\x82\x5d\xc6\x42\xcb\x6e\xb9\xa0\x60" \ "\xe5\x4b\xf8\xd6\x92\x88\xfb\xee\x49\x04" +#define EMPTY_TREE_SHA1_BIN \ + ((const unsigned char *) EMPTY_TREE_SHA1_BIN_LITERAL) int git_mkstemp(char *path, size_t n, const char *template); diff --git a/notes-merge.c b/notes-merge.c index 71c4d45fcd..1467ad3179 100644 --- a/notes-merge.c +++ b/notes-merge.c @@ -615,7 +615,7 @@ int notes_merge(struct notes_merge_options *o, bases = get_merge_bases(local, remote, 1); if (!bases) { base_sha1 = null_sha1; - base_tree_sha1 = (unsigned char *)EMPTY_TREE_SHA1_BIN; + base_tree_sha1 = EMPTY_TREE_SHA1_BIN; OUTPUT(o, 4, "No merge base found; doing history-less merge"); } else if (!bases->next) { base_sha1 = bases->item->object.sha1; diff --git a/sha1_file.c b/sha1_file.c index 0b830c8642..27730c334c 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -52,7 +52,7 @@ static struct cached_object { static int cached_object_nr, cached_object_alloc; static struct cached_object empty_tree = { - EMPTY_TREE_SHA1_BIN, + EMPTY_TREE_SHA1_BIN_LITERAL, OBJ_TREE, "", 0 From 62b8102c60a716e66cfd2a33e596e9d5be134267 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sat, 12 Feb 2011 00:18:51 -0500 Subject: [PATCH 02/11] string_list_append: always set util pointer to NULL It is not immediately obvious that the util field may contain random bytes after appending an item. Especially since the string_list_insert* functions _do_ explicitly zero the util pointer. This does not appear to be a bug in any current git code, as all callers either fill in the util field immediately or never use it. However, it is worth it to be less surprising to new users of the string-list API who may expect it to be intialized to NULL. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- string-list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/string-list.c b/string-list.c index 9b023a2584..51681189e8 100644 --- a/string-list.c +++ b/string-list.c @@ -153,6 +153,7 @@ struct string_list_item *string_list_append(struct string_list *list, const char ALLOC_GROW(list->items, list->nr + 1, list->alloc); list->items[list->nr].string = list->strdup_strings ? xstrdup(string) : (char *)string; + list->items[list->nr].util = NULL; return list->items + list->nr++; } From 1e58dba142c673c59fbb9d10aeecf62217d4fc9c Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 2 Jan 2011 11:24:55 +0100 Subject: [PATCH 03/11] configure: use AC_LANG_PROGRAM consistently Avoid warnings from Autoconf 2.68 about missing use of AC_LANG_PROGRAM and friends. Quoting autoconf-2.68/NEWS: ** The macros AC_PREPROC_IFELSE, AC_COMPILE_IFELSE, AC_LINK_IFELSE, and AC_RUN_IFELSE now warn if the first argument failed to use AC_LANG_SOURCE or AC_LANG_PROGRAM to generate the conftest file contents. A new macro AC_LANG_DEFINES_PROVIDED exists if you have a compelling reason why you cannot use AC_LANG_SOURCE but must avoid the warning. The underlying reason for that change is that AC_LANG_{SOURCE,PROGRAM} take care to supply the previously computed set of #defines (and include standard headers if so desired) for preprocessed languages like C and C++. In some cases, AC_LANG_PROGRAM is already used but not sufficiently m4-quoted, so we just need to add another set of [quotes] to prevent the autoconf warning from being triggered bogusly. Quoting all arguments (except when calling special macros that need to be expanded before recursion) is better style, anyway. These and more rules are described in detail in 'info Autoconf "Programming in M4"'. No change in the resulting config.mak.autogen after running ./configure intended. Signed-off-by: Ralf Wildenhues Signed-off-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- aclocal.m4 | 4 ++-- configure.ac | 56 ++++++++++++++++++---------------------------------- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/aclocal.m4 b/aclocal.m4 index d399de2671..f11bc7ed7d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,7 +13,7 @@ AC_DEFUN([TYPE_SOCKLEN_T], git_cv_socklen_t_equiv= for arg2 in "struct sockaddr" void; do for t in int size_t unsigned long "unsigned long"; do - AC_TRY_COMPILE([ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #include #include @@ -21,7 +21,7 @@ AC_DEFUN([TYPE_SOCKLEN_T], ],[ $t len; getpeername(0,0,&len); - ],[ + ])],[ git_cv_socklen_t_equiv="$t" break 2 ]) diff --git a/configure.ac b/configure.ac index 5792425a49..20039c546f 100644 --- a/configure.ac +++ b/configure.ac @@ -345,7 +345,7 @@ esac AC_CACHE_CHECK([if linker supports -R], git_cv_ld_dashr, [ SAVE_LDFLAGS="${LDFLAGS}" LDFLAGS="${SAVE_LDFLAGS} -R /" - AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_dashr=yes], [git_cv_ld_dashr=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_dashr=yes], [git_cv_ld_dashr=no]) LDFLAGS="${SAVE_LDFLAGS}" ]) if test "$git_cv_ld_dashr" = "yes"; then @@ -354,7 +354,7 @@ else AC_CACHE_CHECK([if linker supports -Wl,-rpath,], git_cv_ld_wl_rpath, [ SAVE_LDFLAGS="${LDFLAGS}" LDFLAGS="${SAVE_LDFLAGS} -Wl,-rpath,/" - AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_wl_rpath=yes], [git_cv_ld_wl_rpath=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_wl_rpath=yes], [git_cv_ld_wl_rpath=no]) LDFLAGS="${SAVE_LDFLAGS}" ]) if test "$git_cv_ld_wl_rpath" = "yes"; then @@ -363,7 +363,7 @@ else AC_CACHE_CHECK([if linker supports -rpath], git_cv_ld_rpath, [ SAVE_LDFLAGS="${LDFLAGS}" LDFLAGS="${SAVE_LDFLAGS} -rpath /" - AC_LINK_IFELSE(AC_LANG_PROGRAM([], []), [git_cv_ld_rpath=yes], [git_cv_ld_rpath=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [git_cv_ld_rpath=yes], [git_cv_ld_rpath=no]) LDFLAGS="${SAVE_LDFLAGS}" ]) if test "$git_cv_ld_rpath" = "yes"; then @@ -472,15 +472,9 @@ if test -z "$NO_ICONV"; then GIT_STASH_FLAGS($ICONVDIR) -AC_DEFUN([ICONVTEST_SRC], [ -#include - -int main(void) -{ - iconv_open("", ""); - return 0; -} -]) +AC_DEFUN([ICONVTEST_SRC], +[AC_LANG_PROGRAM([#include ], + [iconv_open("", "");])]) if test -n "$ICONVDIR"; then lib_order="-liconv -lc" @@ -500,7 +494,7 @@ for l in $lib_order; do old_LIBS="$LIBS" LIBS="$LIBS $l" AC_MSG_CHECKING([for iconv in $l]) - AC_LINK_IFELSE(ICONVTEST_SRC, + AC_LINK_IFELSE([ICONVTEST_SRC], [AC_MSG_RESULT([yes]) NO_ICONV= break], @@ -528,18 +522,12 @@ fi GIT_STASH_FLAGS($ZLIB_PATH) AC_DEFUN([ZLIBTEST_SRC], [ -#include - -int main(void) -{ - deflateBound(0, 0); - return 0; -} -]) +AC_LANG_PROGRAM([#include ], + [deflateBound(0, 0);])]) AC_MSG_CHECKING([for deflateBound in -lz]) old_LIBS="$LIBS" LIBS="$LIBS -lz" -AC_LINK_IFELSE(ZLIBTEST_SRC, +AC_LINK_IFELSE([ZLIBTEST_SRC], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) NO_DEFLATE_BOUND=yes]) @@ -631,23 +619,19 @@ AC_SUBST(NO_INTTYPES_H) # # Define OLD_ICONV if your library has an old iconv(), where the second # (input buffer pointer) parameter is declared with type (const char **). -AC_DEFUN([OLDICONVTEST_SRC], [[ +AC_DEFUN([OLDICONVTEST_SRC], [ +AC_LANG_PROGRAM([[ #include extern size_t iconv(iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); - -int main(void) -{ - return 0; -} -]]) +]], [])]) GIT_STASH_FLAGS($ICONVDIR) AC_MSG_CHECKING([for old iconv()]) -AC_COMPILE_IFELSE(OLDICONVTEST_SRC, +AC_COMPILE_IFELSE([OLDICONVTEST_SRC], [AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes]) OLD_ICONV=UnfortunatelyYes]) @@ -931,18 +915,16 @@ AC_SUBST(NO_INITGROUPS) # # Define PTHREAD_LIBS to the linker flag used for Pthread support. AC_DEFUN([PTHREADTEST_SRC], [ +AC_LANG_PROGRAM([[ #include - -int main(void) -{ +]], [[ pthread_mutex_t test_mutex; int retcode = 0; retcode |= pthread_mutex_init(&test_mutex,(void *)0); retcode |= pthread_mutex_lock(&test_mutex); retcode |= pthread_mutex_unlock(&test_mutex); return retcode; -} -]) +]])]) dnl AC_LANG_CONFTEST([AC_LANG_PROGRAM( dnl [[#include ]], @@ -962,7 +944,7 @@ elif test -z "$PTHREAD_CFLAGS"; then old_CFLAGS="$CFLAGS" CFLAGS="$opt $CFLAGS" AC_MSG_CHECKING([Checking for POSIX Threads with '$opt']) - AC_LINK_IFELSE(PTHREADTEST_SRC, + AC_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) NO_PTHREADS= PTHREAD_LIBS="$opt" @@ -982,7 +964,7 @@ else old_CFLAGS="$CFLAGS" CFLAGS="$PTHREAD_CFLAGS $CFLAGS" AC_MSG_CHECKING([Checking for POSIX Threads with '$PTHREAD_CFLAGS']) - AC_LINK_IFELSE(PTHREADTEST_SRC, + AC_LINK_IFELSE([PTHREADTEST_SRC], [AC_MSG_RESULT([yes]) NO_PTHREADS= PTHREAD_LIBS="$PTHREAD_CFLAGS" From 726c4e3d4251d55a944c9d5f3694d55554ace83d Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:04 +0100 Subject: [PATCH 04/11] commit,tag: use same wording for -F Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- builtin/tag.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 03cff5af63..8a534de3cc 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -118,7 +118,7 @@ static struct option builtin_commit_options[] = { OPT__VERBOSE(&verbose, "show diff in commit message template"), OPT_GROUP("Commit message options"), - OPT_FILENAME('F', "file", &logfile, "read log from file"), + OPT_FILENAME('F', "file", &logfile, "read message from file"), OPT_STRING(0, "author", &force_author, "AUTHOR", "override author for commit"), OPT_STRING(0, "date", &force_date, "DATE", "override date for commit"), OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m), diff --git a/builtin/tag.c b/builtin/tag.c index aa1f87d47a..6408171f9b 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -378,7 +378,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix) "annotated tag, needs a message"), OPT_CALLBACK('m', NULL, &msg, "msg", "message for the tag", parse_msg_arg), - OPT_FILENAME('F', NULL, &msgfile, "message in a file"), + OPT_FILENAME('F', NULL, &msgfile, "read message from file"), OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"), OPT_STRING('u', NULL, &keyid, "key-id", "use another key to sign the tag"), From ba9d7fe11c485b5fc10a17c67c8871792ee6ef12 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:05 +0100 Subject: [PATCH 05/11] commit,status: describe --porcelain just like push Push has the clearer description, so take that one for all. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 8a534de3cc..0245d9f2ce 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -145,7 +145,7 @@ static struct option builtin_commit_options[] = { STATUS_FORMAT_SHORT), OPT_BOOLEAN(0, "branch", &status_show_branch, "show branch information"), OPT_SET_INT(0, "porcelain", &status_format, - "show porcelain output format", STATUS_FORMAT_PORCELAIN), + "machine-readable output", STATUS_FORMAT_PORCELAIN), OPT_BOOLEAN('z', "null", &null_termination, "terminate entries with NUL"), OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"), @@ -1092,7 +1092,7 @@ int cmd_status(int argc, const char **argv, const char *prefix) OPT_BOOLEAN('b', "branch", &status_show_branch, "show branch information"), OPT_SET_INT(0, "porcelain", &status_format, - "show porcelain output format", + "machine-readable output", STATUS_FORMAT_PORCELAIN), OPT_BOOLEAN('z', "null", &null_termination, "terminate entries with NUL"), From 5027fa864dafd5a054aab2de6b4bae089f344fc6 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:06 +0100 Subject: [PATCH 06/11] clone,init: describe --template using the same wording This also corrects a wrong description for clone. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/clone.c | 4 ++-- builtin/init-db.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/clone.c b/builtin/clone.c index 82a6938620..60d9a64280 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -68,8 +68,8 @@ static struct option builtin_clone_options[] = { "initialize submodules in the clone"), OPT_BOOLEAN(0, "recurse-submodules", &option_recursive, "initialize submodules in the clone"), - OPT_STRING(0, "template", &option_template, "path", - "path the template repository"), + OPT_STRING(0, "template", &option_template, "template-directory", + "directory from which templates will be used"), OPT_STRING(0, "reference", &option_reference, "repo", "reference repository"), OPT_STRING('o', "origin", &option_origin, "branch", diff --git a/builtin/init-db.c b/builtin/init-db.c index e3af9eaa87..4f5348eec6 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -419,7 +419,7 @@ int cmd_init_db(int argc, const char **argv, const char *prefix) unsigned int flags = 0; const struct option init_db_options[] = { OPT_STRING(0, "template", &template_dir, "template-directory", - "provide the directory from which templates will be used"), + "directory from which templates will be used"), OPT_SET_INT(0, "bare", &is_bare_repository_cfg, "create a bare repository", 1), { OPTION_CALLBACK, 0, "shared", &init_shared_repository, From 3f40617566a2f683835de9efab54df0f14b19b70 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:07 +0100 Subject: [PATCH 07/11] commit,merge,tag: describe -m likewise This also removes the superfluous "specify" and rewords the misleading "if any" which sounds as if omitting "-m" would omit the merge commit message. (It means "if a merge commit is created at all".) Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- builtin/merge.c | 4 ++-- builtin/tag.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 0245d9f2ce..0090571adf 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -121,7 +121,7 @@ static struct option builtin_commit_options[] = { OPT_FILENAME('F', "file", &logfile, "read message from file"), OPT_STRING(0, "author", &force_author, "AUTHOR", "override author for commit"), OPT_STRING(0, "date", &force_date, "DATE", "override date for commit"), - OPT_CALLBACK('m', "message", &message, "MESSAGE", "specify commit message", opt_parse_m), + OPT_CALLBACK('m', "message", &message, "MESSAGE", "commit message", opt_parse_m), OPT_STRING('c', "reedit-message", &edit_message, "COMMIT", "reuse and edit message from specified commit"), OPT_STRING('C', "reuse-message", &use_message, "COMMIT", "reuse message from specified commit"), OPT_STRING(0, "fixup", &fixup_message, "COMMIT", "use autosquash formatted message to fixup specified commit"), diff --git a/builtin/merge.c b/builtin/merge.c index 42fff387e6..a682043fe5 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -194,8 +194,8 @@ static struct option builtin_merge_options[] = { "merge strategy to use", option_parse_strategy), OPT_CALLBACK('X', "strategy-option", &xopts, "option=value", "option for selected merge strategy", option_parse_x), - OPT_CALLBACK('m', "message", &merge_msg, "message", - "message to be used for the merge commit (if any)", + OPT_CALLBACK('m', "message", &merge_msg, "MESSAGE", + "merge commit message (for a non-fast-forward merge)", option_parse_message), OPT__VERBOSITY(&verbosity), OPT_BOOLEAN(0, "abort", &abort_current_merge, diff --git a/builtin/tag.c b/builtin/tag.c index 6408171f9b..246a2bc72b 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -376,8 +376,8 @@ int cmd_tag(int argc, const char **argv, const char *prefix) OPT_GROUP("Tag creation options"), OPT_BOOLEAN('a', NULL, &annotate, "annotated tag, needs a message"), - OPT_CALLBACK('m', NULL, &msg, "msg", - "message for the tag", parse_msg_arg), + OPT_CALLBACK('m', NULL, &msg, "MESSAGE", + "tag message", parse_msg_arg), OPT_FILENAME('F', NULL, &msgfile, "read message from file"), OPT_BOOLEAN('s', NULL, &sign, "annotated and GPG-signed tag"), OPT_STRING('u', NULL, &keyid, "key-id", From 08918e4a38e7aff66077b6325e5b69a4a4e02abf Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:08 +0100 Subject: [PATCH 08/11] add: describe --patch like checkout, reset Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/add.c b/builtin/add.c index 12b964e642..42c906ea06 100644 --- a/builtin/add.c +++ b/builtin/add.c @@ -317,7 +317,7 @@ static struct option builtin_add_options[] = { OPT__VERBOSE(&verbose, "be verbose"), OPT_GROUP(""), OPT_BOOLEAN('i', "interactive", &add_interactive, "interactive picking"), - OPT_BOOLEAN('p', "patch", &patch_interactive, "interactive patching"), + OPT_BOOLEAN('p', "patch", &patch_interactive, "select hunks interactively"), OPT_BOOLEAN('e', "edit", &edit_interactive, "edit current diff and apply"), OPT__FORCE(&ignored_too, "allow adding otherwise ignored files"), OPT_BOOLEAN('u', "update", &take_worktree_changes, "update tracked files"), From 8547090c9265bcde7a75feeddcbf49a3eddeaaac Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:09 +0100 Subject: [PATCH 09/11] commit,status: describe -u likewise They differ by one character only. Being exactly equal should help translations. Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/commit.c b/builtin/commit.c index 0090571adf..d7f55e3d46 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -150,7 +150,7 @@ static struct option builtin_commit_options[] = { "terminate entries with NUL"), OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"), OPT_BOOLEAN(0, "no-post-rewrite", &no_post_rewrite, "bypass post-rewrite hook"), - { OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal, no (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" }, + { OPTION_STRING, 'u', "untracked-files", &untracked_files_arg, "mode", "show untracked files, optional modes: all, normal, no. (Default: all)", PARSE_OPT_OPTARG, NULL, (intptr_t)"all" }, /* end commit contents options */ { OPTION_BOOLEAN, 0, "allow-empty", &allow_empty, NULL, From cfb5e6b2da96c7803aa4a3813d27d2cbb47cda9e Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Tue, 15 Feb 2011 14:09:10 +0100 Subject: [PATCH 10/11] git-tag.txt: list all modes in the description Currently, the description sounds as if it applied always, but most of its content is true in "create tag mode" only. Make this clearer by listing all modes upfront. Also, sneak in some linguistic improvements and make it clearer that lightweight tags are "created" because "written" may be misread as "are output". Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- Documentation/git-tag.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt index 8b169e364a..65f76c5440 100644 --- a/Documentation/git-tag.txt +++ b/Documentation/git-tag.txt @@ -18,21 +18,22 @@ SYNOPSIS DESCRIPTION ----------- -Adds a tag reference in `.git/refs/tags/`. +Add a tag reference in `.git/refs/tags/`, unless `-d/-l/-v` is given +to delete, list or verify tags. -Unless `-f` is given, the tag must not yet exist in +Unless `-f` is given, the tag to be created must not yet exist in the `.git/refs/tags/` directory. If one of `-a`, `-s`, or `-u ` is passed, the command -creates a 'tag' object, and requires the tag message. Unless +creates a 'tag' object, and requires a tag message. Unless `-m ` or `-F ` is given, an editor is started for the user to type in the tag message. If `-m ` or `-F ` is given and `-a`, `-s`, and `-u ` are absent, `-a` is implied. -Otherwise just the SHA1 object name of the commit object is -written (i.e. a lightweight tag). +Otherwise just a tag reference for the SHA1 object name of the commit object is +created (i.e. a lightweight tag). A GnuPG signed tag object will be created when `-s` or `-u ` is used. When `-u ` is not used, the From 24231e063f0f003f8ffd7b64c7ba6a0baaaa5283 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Mon, 14 Feb 2011 17:48:08 +0100 Subject: [PATCH 11/11] pull: do not display fetch usage on --help-all Currently, "git pull --help-all" displays the fetch usage info. Make it equivalent to "git pull -h" instead since "--help-all" is documented in gitcli(7). Do not try to sanitize the pull option parser (aka last hair puller). Signed-off-by: Michael J Gruber Signed-off-by: Junio C Hamano --- git-pull.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-pull.sh b/git-pull.sh index eb87f49062..f6b7b84048 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -114,7 +114,7 @@ do --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run) dry_run=--dry-run ;; - -h|--h|--he|--hel|--help) + -h|--h|--he|--hel|--help|--help-|--help-a|--help-al|--help-all) usage ;; *)