Merge branch 'maint'
* maint: pull: do not display fetch usage on --help-all git-tag.txt: list all modes in the description commit,status: describe -u likewise add: describe --patch like checkout, reset commit,merge,tag: describe -m likewise clone,init: describe --template using the same wording commit,status: describe --porcelain just like push commit,tag: use same wording for -F configure: use AC_LANG_PROGRAM consistently string_list_append: always set util pointer to NULL correct type of EMPTY_TREE_SHA1_BINmaint
commit
43f9f05301
|
@ -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 <key-id>` 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 <msg>` or `-F <file>` is given, an editor is started for the user to type
|
||||
in the tag message.
|
||||
|
||||
If `-m <msg>` or `-F <file>` is given and `-a`, `-s`, and `-u <key-id>`
|
||||
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
|
||||
<key-id>` is used. When `-u <key-id>` is not used, the
|
||||
|
|
|
@ -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 <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
|
@ -21,7 +21,7 @@ AC_DEFUN([TYPE_SOCKLEN_T],
|
|||
],[
|
||||
$t len;
|
||||
getpeername(0,0,&len);
|
||||
],[
|
||||
])],[
|
||||
git_cv_socklen_t_equiv="$t"
|
||||
break 2
|
||||
])
|
||||
|
|
|
@ -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"),
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -118,10 +118,10 @@ 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),
|
||||
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"),
|
||||
|
@ -145,12 +145,12 @@ 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"),
|
||||
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,
|
||||
|
@ -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"),
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -376,9 +376,9 @@ 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_FILENAME('F', NULL, &msgfile, "message in a file"),
|
||||
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",
|
||||
"use another key to sign the tag"),
|
||||
|
|
4
cache.h
4
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);
|
||||
|
||||
|
|
56
configure.ac
56
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 <iconv.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
iconv_open("", "");
|
||||
return 0;
|
||||
}
|
||||
])
|
||||
AC_DEFUN([ICONVTEST_SRC],
|
||||
[AC_LANG_PROGRAM([#include <iconv.h>],
|
||||
[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 <zlib.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
deflateBound(0, 0);
|
||||
return 0;
|
||||
}
|
||||
])
|
||||
AC_LANG_PROGRAM([#include <zlib.h>],
|
||||
[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 <iconv.h>
|
||||
|
||||
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 <pthread.h>
|
||||
|
||||
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 <pthread.h>]],
|
||||
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue