summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes/1.7.4.5.txt4
-rw-r--r--Documentation/RelNotes/1.7.5.txt10
-rw-r--r--Documentation/SubmittingPatches3
-rw-r--r--Documentation/config.txt2
-rw-r--r--Documentation/git-archive.txt3
-rw-r--r--Documentation/git-blame.txt7
-rw-r--r--Documentation/git-fetch.txt2
-rw-r--r--Documentation/git-pack-objects.txt2
-rw-r--r--Documentation/git-svn.txt17
-rw-r--r--Documentation/git.txt9
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--builtin/blame.c9
-rw-r--r--builtin/log.c30
-rw-r--r--builtin/pack-objects.c8
-rw-r--r--builtin/revert.c3
-rw-r--r--builtin/show-branch.c16
-rw-r--r--cache.h1
-rw-r--r--color.c22
-rw-r--r--color.h3
-rw-r--r--compat/mingw.c2
-rw-r--r--compat/nedmalloc/malloc.c.h10
-rw-r--r--config.c6
-rwxr-xr-xcontrib/completion/git-completion.bash16
-rw-r--r--dir.c2
-rw-r--r--environment.c1
-rw-r--r--fast-import.c5
-rwxr-xr-xgit-stash.sh16
-rwxr-xr-xgit-svn.perl17
-rw-r--r--gitweb/README2
-rw-r--r--graph.c23
-rw-r--r--run-command.c17
-rw-r--r--sha1_file.c2
-rw-r--r--sha1_name.c11
-rwxr-xr-xt/t0001-init.sh2
-rwxr-xr-xt/t1411-reflog-show.sh18
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh17
-rwxr-xr-xt/t2021-checkout-overwrite.sh2
-rwxr-xr-xt/t3306-notes-prune.sh3
-rwxr-xr-xt/t3903-stash.sh36
-rwxr-xr-xt/t5304-prune.sh3
-rwxr-xr-xt/t7300-clean.sh7
-rwxr-xr-xt/t9146-git-svn-empty-dirs.sh17
-rw-r--r--upload-pack.c23
-rw-r--r--vcs-svn/trp.txt2
44 files changed, 258 insertions, 155 deletions
diff --git a/Documentation/RelNotes/1.7.4.5.txt b/Documentation/RelNotes/1.7.4.5.txt
new file mode 100644
index 0000000..b7a0eeb
--- /dev/null
+++ b/Documentation/RelNotes/1.7.4.5.txt
@@ -0,0 +1,4 @@
+Git v1.7.4.5 Release Notes
+==========================
+
+This contains only minor documentation fixes accumulated since 1.7.4.4.
diff --git a/Documentation/RelNotes/1.7.5.txt b/Documentation/RelNotes/1.7.5.txt
index b1b2513..987919c 100644
--- a/Documentation/RelNotes/1.7.5.txt
+++ b/Documentation/RelNotes/1.7.5.txt
@@ -1,4 +1,4 @@
-Git v1.7.5 Release Notes (draft)
+Git v1.7.5 Release Notes
========================
Updates since v1.7.4
@@ -8,7 +8,7 @@ Updates since v1.7.4
* Various git-p4 enhancements (in contrib).
- * Various vcs-svn enhancements.
+ * Various vcs-svn, git-svn and gitk enhancements and fixes.
* Various git-gui updates (0.14.0).
@@ -130,9 +130,3 @@ release, unless otherwise noted.
doing both a mirror fetch and a mirror push at the same time, which
made little sense. We now warn and require the command line to specify
either --mirror=fetch or --mirror=push.
-
----
-exec >/var/tmp/1
-O=v1.7.5-rc1
-echo O=$(git describe 'master')
-git shortlog --no-merges ^maint ^$O master
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index c3b0816..c6a5032 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -276,7 +276,7 @@ don't hide your real name.
If you like, you can put extra tags at the end:
-1. "Reported-by:" is used to to credit someone who found the bug that
+1. "Reported-by:" is used to credit someone who found the bug that
the patch attempts to fix.
2. "Acked-by:" says that the person who is more familiar with the area
the patch attempts to modify liked the patch.
@@ -608,4 +608,3 @@ following commands:
Just make sure to disable line wrapping in the email client (GMail web
interface will line wrap no matter what, so you need to use a real
IMAP client).
-
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 750c86d..0906499 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -442,8 +442,6 @@ for most projects as source code and other text files can still
be delta compressed, but larger binary media files won't be.
+
Common unit suffixes of 'k', 'm', or 'g' are supported.
-+
-Currently only linkgit:git-fast-import[1] honors this setting.
core.excludesfile::
In addition to '.gitignore' (per-directory) and
diff --git a/Documentation/git-archive.txt b/Documentation/git-archive.txt
index f2b8684..9c750e2 100644
--- a/Documentation/git-archive.txt
+++ b/Documentation/git-archive.txt
@@ -98,7 +98,8 @@ tar.umask::
tar archive entries. The default is 0002, which turns off the
world write bit. The special value "user" indicates that the
archiving user's umask will be used instead. See umask(2) for
- details.
+ details. If `--remote` is used then only the configuration of
+ the remote repository takes effect.
ATTRIBUTES
----------
diff --git a/Documentation/git-blame.txt b/Documentation/git-blame.txt
index c4d1ff8..bb8edb4 100644
--- a/Documentation/git-blame.txt
+++ b/Documentation/git-blame.txt
@@ -9,7 +9,7 @@ SYNOPSIS
--------
[verse]
'git blame' [-c] [-b] [-l] [--root] [-t] [-f] [-n] [-s] [-e] [-p] [-w] [--incremental] [-L n,m]
- [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>]
+ [-S <revs-file>] [-M] [-C] [-C] [-C] [--since=<date>] [--abbrev=<n>]
[<rev> | --contents <file> | --reverse <rev>] [--] <file>
DESCRIPTION
@@ -73,6 +73,11 @@ include::blame-options.txt[]
Ignore whitespace when comparing the parent's version and
the child's to find where the lines came from.
+--abbrev=<n>::
+ Instead of using the default 7+1 hexadecimal digits as the
+ abbreviated object name, use <n>+1 digits. Note that 1 column
+ is used for a caret to mark the boundary commit.
+
THE PORCELAIN FORMAT
--------------------
diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt
index 67d2214..60ac8d2 100644
--- a/Documentation/git-fetch.txt
+++ b/Documentation/git-fetch.txt
@@ -34,7 +34,7 @@ pointed by remote tags that it does not yet have, then fetch
those missing tags. If the other end has tags that point at
branches you are not interested in, you will not get them.
-'git fetch' can fetch from either a single named repository, or
+'git fetch' can fetch from either a single named repository,
or from several repositories at once if <group> is given and
there is a remotes.<group> entry in the configuration file.
(See linkgit:git-config[1]).
diff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt
index 08c89d2..20c8551 100644
--- a/Documentation/git-pack-objects.txt
+++ b/Documentation/git-pack-objects.txt
@@ -115,7 +115,7 @@ base-name::
--honor-pack-keep::
This flag causes an object already in a local pack that
- has a .keep file to be ignored, even if it it would have
+ has a .keep file to be ignored, even if it would have
otherwise been packed.
--incremental::
diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt
index 4aa6404..71fc0ae 100644
--- a/Documentation/git-svn.txt
+++ b/Documentation/git-svn.txt
@@ -217,6 +217,13 @@ config key: svn.commiturl (overwrites all svn-remote.<name>.commiturl options)
Using this option for any other purpose (don't ask) is very strongly
discouraged.
+--mergeinfo=<mergeinfo>;;
+ Add the given merge information during the dcommit
+ (e.g. `--mergeinfo="/branches/foo:1-10"`). All svn server versions can
+ store this information (as a property), and svn clients starting from
+ version 1.5 can make use of it. 'git svn' currently does not use it
+ and does not set it automatically.
+
'branch'::
Create a branch in the SVN repository.
@@ -343,6 +350,8 @@ Any other arguments are passed directly to 'git log'
Empty directories are automatically recreated when using
"git svn clone" and "git svn rebase", so "mkdirs" is intended
for use after commands like "git checkout" or "git reset".
+ (See the svn-remote.<name>.automkdirs config file option for
+ more information.)
'commit-diff'::
Commits the diff of two tree-ish arguments from the
@@ -673,6 +682,14 @@ svn.pathnameencoding::
locales to avoid corrupted file names with non-ASCII characters.
Valid encodings are the ones supported by Perl's Encode module.
+svn-remote.<name>.automkdirs::
+ Normally, the "git svn clone" and "git svn rebase" commands
+ attempt to recreate empty directories that are in the
+ Subversion repository. If this option is set to "false", then
+ empty directories will only be created if the "git svn mkdirs"
+ command is run explicitly. If unset, 'git svn' assumes this
+ option to be "true".
+
Since the noMetadata, rewriteRoot, rewriteUUID, useSvnsyncProps and useSvmProps
options all affect the metadata generated and used by 'git svn'; they
*must* be set in the configuration file before any history is imported
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 7df49ea..9d59492 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -44,9 +44,15 @@ unreleased) version of git, that is available from 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
-* link:v1.7.4.4/git.html[documentation for release 1.7.4.4]
+* link:v1.7.5/git.html[documentation for release 1.7.5]
* release notes for
+ link:RelNotes/1.7.5.txt[1.7.5].
+
+* link:v1.7.4.5/git.html[documentation for release 1.7.4.5]
+
+* release notes for
+ link:RelNotes/1.7.4.5.txt[1.7.4.5],
link:RelNotes/1.7.4.4.txt[1.7.4.4],
link:RelNotes/1.7.4.3.txt[1.7.4.3],
link:RelNotes/1.7.4.2.txt[1.7.4.2],
@@ -622,7 +628,6 @@ where:
contents of <old|new>,
<old|new>-hex:: are the 40-hexdigit SHA1 hashes,
<old|new>-mode:: are the octal representation of the file modes.
-
+
The file parameters can point at the user's working file
(e.g. `new-file` in "git-diff-files"), `/dev/null` (e.g. `old-file`
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index e9b2a47..68691b3 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v1.7.5-rc1
+DEF_VER=v1.7.5
LF='
'
diff --git a/builtin/blame.c b/builtin/blame.c
index f6b03f7..4639788 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -41,6 +41,7 @@ static int reverse;
static int blank_boundary;
static int incremental;
static int xdl_opts;
+static int abbrev = -1;
static enum date_mode blame_date_mode = DATE_ISO8601;
static size_t blame_date_width;
@@ -1670,7 +1671,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
cp = nth_line(sb, ent->lno);
for (cnt = 0; cnt < ent->num_lines; cnt++) {
char ch;
- int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? 40 : 8;
+ int length = (opt & OUTPUT_LONG_OBJECT_NAME) ? 40 : abbrev;
if (suspect->commit->object.flags & UNINTERESTING) {
if (blank_boundary)
@@ -2310,6 +2311,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
{ OPTION_CALLBACK, 'C', NULL, &opt, "score", "Find line copies within and across files", PARSE_OPT_OPTARG, blame_copy_callback },
{ OPTION_CALLBACK, 'M', NULL, &opt, "score", "Find line movements within and across files", PARSE_OPT_OPTARG, blame_move_callback },
OPT_CALLBACK('L', NULL, &bottomtop, "n,m", "Process only line range n,m, counting from 1", blame_bottomtop_callback),
+ OPT__ABBREV(&abbrev),
OPT_END()
};
@@ -2345,6 +2347,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);
+ if (abbrev == -1)
+ abbrev = default_abbrev;
+ /* one more abbrev length is needed for the boundary commit */
+ abbrev++;
+
if (revs_file && read_ancestry(revs_file))
die_errno("reading graft file '%s' failed", revs_file);
diff --git a/builtin/log.c b/builtin/log.c
index 9db43ed..916019c 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -49,13 +49,8 @@ static int parse_decoration_style(const char *var, const char *value)
return -1;
}
-static void cmd_log_init(int argc, const char **argv, const char *prefix,
- struct rev_info *rev, struct setup_revision_opt *opt)
+static void cmd_log_init_defaults(struct rev_info *rev)
{
- int i;
- int decoration_given = 0;
- struct userformat_want w;
-
rev->abbrev = DEFAULT_ABBREV;
rev->commit_format = CMIT_FMT_DEFAULT;
if (fmt_pretty)
@@ -68,7 +63,14 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
if (default_date_mode)
rev->date_mode = parse_date_format(default_date_mode);
+}
+static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
+ struct rev_info *rev, struct setup_revision_opt *opt)
+{
+ int i;
+ int decoration_given = 0;
+ struct userformat_want w;
/*
* Check for -h before setup_revisions(), or "git log -h" will
* fail when run without a git directory.
@@ -128,6 +130,13 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
setup_pager();
}
+static void cmd_log_init(int argc, const char **argv, const char *prefix,
+ struct rev_info *rev, struct setup_revision_opt *opt)
+{
+ cmd_log_init_defaults(rev);
+ cmd_log_init_finish(argc, argv, prefix, rev, opt);
+}
+
/*
* This gives a rough estimate for how many commits we
* will print out in the list.
@@ -486,16 +495,11 @@ int cmd_log_reflog(int argc, const char **argv, const char *prefix)
rev.verbose_header = 1;
memset(&opt, 0, sizeof(opt));
opt.def = "HEAD";
- cmd_log_init(argc, argv, prefix, &rev, &opt);
-
- /*
- * This means that we override whatever commit format the user gave
- * on the cmd line. Sad, but cmd_log_init() currently doesn't
- * allow us to set a different default.
- */
+ cmd_log_init_defaults(&rev);
rev.commit_format = CMIT_FMT_ONELINE;
rev.use_terminator = 1;
rev.always_show_header = 1;
+ cmd_log_init_finish(argc, argv, prefix, &rev, &opt);
return cmd_log_walk(&rev);
}
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index b0503b2..f402a84 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1142,8 +1142,12 @@ static void get_object_details(void)
sorted_by_offset[i] = objects + i;
qsort(sorted_by_offset, nr_objects, sizeof(*sorted_by_offset), pack_offset_sort);
- for (i = 0; i < nr_objects; i++)
- check_object(sorted_by_offset[i]);
+ for (i = 0; i < nr_objects; i++) {
+ struct object_entry *entry = sorted_by_offset[i];
+ check_object(entry);
+ if (big_file_threshold <= entry->size)
+ entry->no_try_delta = 1;
+ }
free(sorted_by_offset);
}
diff --git a/builtin/revert.c b/builtin/revert.c
index 2bb13eb..f697e66 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -76,7 +76,8 @@ static void parse_args(int argc, const char **argv)
struct option options[] = {
OPT_BOOLEAN('n', "no-commit", &no_commit, "don't automatically commit"),
OPT_BOOLEAN('e', "edit", &edit, "edit the commit message"),
- OPT_BOOLEAN('r', NULL, &noop, "no-op (backward compatibility)"),
+ { OPTION_BOOLEAN, 'r', NULL, &noop, NULL, "no-op (backward compatibility)",
+ PARSE_OPT_NOARG | PARSE_OPT_HIDDEN, NULL, 0 },
OPT_BOOLEAN('s', "signoff", &signoff, "add Signed-off-by:"),
OPT_INTEGER('m', "mainline", &mainline, "parent number"),
OPT_RERERE_AUTOUPDATE(&allow_rerere_auto),
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index da69581..1abcd9e 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -12,16 +12,6 @@ static const char* show_branch_usage[] = {
};
static int showbranch_use_color = -1;
-static char column_colors[][COLOR_MAXLEN] = {
- GIT_COLOR_RED,
- GIT_COLOR_GREEN,
- GIT_COLOR_YELLOW,
- GIT_COLOR_BLUE,
- GIT_COLOR_MAGENTA,
- GIT_COLOR_CYAN,
-};
-
-#define COLUMN_COLORS_MAX (ARRAY_SIZE(column_colors))
static int default_num;
static int default_alloc;
@@ -37,7 +27,7 @@ static const char **default_arg;
static const char *get_color_code(int idx)
{
if (showbranch_use_color)
- return column_colors[idx];
+ return column_colors_ansi[idx % column_colors_ansi_max];
return "";
}
@@ -892,7 +882,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (j = 0; j < i; j++)
putchar(' ');
printf("%s%c%s [%s] ",
- get_color_code(i % COLUMN_COLORS_MAX),
+ get_color_code(i),
is_head ? '*' : '!',
get_color_reset_code(), ref_name[i]);
}
@@ -954,7 +944,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
else
mark = '+';
printf("%s%c%s",
- get_color_code(i % COLUMN_COLORS_MAX),
+ get_color_code(i),
mark, get_color_reset_code());
}
putchar(' ');
diff --git a/cache.h b/cache.h
index 2674f4c..28899b7 100644
--- a/cache.h
+++ b/cache.h
@@ -573,6 +573,7 @@ extern int core_compression_seen;
extern size_t packed_git_window_size;
extern size_t packed_git_limit;
extern size_t delta_base_cache_limit;
+extern unsigned long big_file_threshold;
extern int read_replace_refs;
extern int fsync_object_files;
extern int core_preload_index;
diff --git a/color.c b/color.c
index 417cf8f..3db214c 100644
--- a/color.c
+++ b/color.c
@@ -3,6 +3,28 @@
int git_use_color_default = 0;
+/*
+ * The list of available column colors.
+ */
+const char *column_colors_ansi[] = {
+ GIT_COLOR_RED,
+ GIT_COLOR_GREEN,
+ GIT_COLOR_YELLOW,
+ GIT_COLOR_BLUE,
+ GIT_COLOR_MAGENTA,
+ GIT_COLOR_CYAN,
+ GIT_COLOR_BOLD_RED,
+ GIT_COLOR_BOLD_GREEN,
+ GIT_COLOR_BOLD_YELLOW,
+ GIT_COLOR_BOLD_BLUE,
+ GIT_COLOR_BOLD_MAGENTA,
+ GIT_COLOR_BOLD_CYAN,
+ GIT_COLOR_RESET,
+};
+
+/* Ignore the RESET at the end when giving the size */
+const int column_colors_ansi_max = ARRAY_SIZE(column_colors_ansi) - 1;
+
static int parse_color(const char *name, int len)
{
static const char * const color_names[] = {
diff --git a/color.h b/color.h
index c0528cf..68a926a 100644
--- a/color.h
+++ b/color.h
@@ -53,6 +53,9 @@ struct strbuf;
*/
extern int git_use_color_default;
+/* A default list of colors to use for commit graphs and show-branch output */
+extern const char *column_colors_ansi[];
+extern const int column_colors_ansi_max;
/*
* Use this instead of git_default_config if you need the value of color.ui.
diff --git a/compat/mingw.c b/compat/mingw.c
index 878b1de..4423961 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1130,7 +1130,7 @@ char **make_augmented_environ(const char *const *vars)
/*
* Note, this isn't a complete replacement for getaddrinfo. It assumes
- * that service contains a numerical port, or that it it is null. It
+ * that service contains a numerical port, or that it is null. It
* does a simple search using gethostbyname, and returns one IPv4 host
* if one was found.
*/
diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h
index 87260d2..ff7c2c4 100644
--- a/compat/nedmalloc/malloc.c.h
+++ b/compat/nedmalloc/malloc.c.h
@@ -100,7 +100,7 @@
If you don't like either of these options, you can define
CORRUPTION_ERROR_ACTION and USAGE_ERROR_ACTION to do anything
- else. And if if you are sure that your program using malloc has
+ else. And if you are sure that your program using malloc has
no errors or vulnerabilities, you can define INSECURE to 1,
which might (or might not) provide a small performance improvement.
@@ -2279,12 +2279,12 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
of the same size are arranged in a circularly-linked list, with only
the oldest chunk (the next to be used, in our FIFO ordering)
actually in the tree. (Tree members are distinguished by a non-null
- parent pointer.) If a chunk with the same size an an existing node
+ parent pointer.) If a chunk with the same size as an existing node
is inserted, it is linked off the existing node using pointers that
work in the same way as fd/bk pointers of small chunks.
Each tree contains a power of 2 sized range of chunk sizes (the
- smallest is 0x100 <= x < 0x180), which is is divided in half at each
+ smallest is 0x100 <= x < 0x180), which is divided in half at each
tree level, with the chunks in the smaller half of the range (0x100
<= x < 0x140 for the top nose) in the left subtree and the larger
half (0x140 <= x < 0x180) in the right subtree. This is, of course,
@@ -3943,7 +3943,7 @@ static void* sys_alloc(mstate m, size_t nb) {
least-preferred order):
1. A call to MORECORE that can normally contiguously extend memory.
(disabled if not MORECORE_CONTIGUOUS or not HAVE_MORECORE or
- or main space is mmapped or a previous contiguous call failed)
+ main space is mmapped or a previous contiguous call failed)
2. A call to MMAP new space (disabled if not HAVE_MMAP).
Note that under the default settings, if MORECORE is unable to
fulfill a request, and HAVE_MMAP is true, then mmap is
@@ -5748,5 +5748,3 @@ History:
structure of old version, but most details differ.)
*/
-
-
diff --git a/config.c b/config.c
index 0abcada..d06fb19 100644
--- a/config.c
+++ b/config.c
@@ -567,6 +567,12 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}
+ if (!strcmp(var, "core.bigfilethreshold")) {
+ long n = git_config_int(var, value);
+ big_file_threshold = 0 < n ? n : 0;
+ return 0;
+ }
+
if (!strcmp(var, "core.packedgitlimit")) {
packed_git_limit = git_config_int(var, value);
return 0;
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 840ae38..9150ea6 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1,6 +1,6 @@
#!bash
#
-# bash completion support for core Git.
+# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
@@ -18,16 +18,12 @@
# To use these routines:
#
# 1) Copy this file to somewhere (e.g. ~/.git-completion.sh).
-# 2) Added the following line to your .bashrc:
-# source ~/.git-completion.sh
-#
-# Or, add the following lines to your .zshrc:
-# autoload bashcompinit
-# bashcompinit
+# 2) Add the following line to your .bashrc/.zshrc:
# source ~/.git-completion.sh
#
# 3) Consider changing your PS1 to also show the current branch:
-# PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
+# Bash: PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
+# ZSH: PS1='[%n@%m %c$(__git_ps1 " (%s)")]\$ '
#
# The argument to __git_ps1 will be displayed only if you
# are currently in a git repository. The %s token will be
@@ -77,6 +73,10 @@
# git@vger.kernel.org
#
+if [[ -n ${ZSH_VERSION-} ]]; then
+ autoload -U +X bashcompinit && bashcompinit
+fi
+
case "$COMP_WORDBREAKS" in
*:*) : great ;;
*) COMP_WORDBREAKS="$COMP_WORDBREAKS:"
diff --git a/dir.c b/dir.c
index 325fb56..532bcb6 100644
--- a/dir.c
+++ b/dir.c
@@ -1192,7 +1192,7 @@ int remove_dir_recursively(struct strbuf *path, int flag)
dir = opendir(path->buf);
if (!dir)
- return -1;
+ return rmdir(path->buf);
if (path->buf[original_len - 1] != '/')
strbuf_addch(path, '/');
diff --git a/environment.c b/environment.c
index f4549d3..40185bc 100644
--- a/environment.c
+++ b/environment.c
@@ -35,6 +35,7 @@ int fsync_object_files;
size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;
size_t packed_git_limit = DEFAULT_PACKED_GIT_LIMIT;
size_t delta_base_cache_limit = 16 * 1024 * 1024;
+unsigned long big_file_threshold = 512 * 1024 * 1024;
const char *pager_program;
int pager_use_color = 1;
const char *editor_program;
diff --git a/fast-import.c b/fast-import.c
index 65d65bf..3e4e655 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -274,7 +274,6 @@ struct recent_command {
/* Configured limits on output */
static unsigned long max_depth = 10;
static off_t max_packsize;
-static uintmax_t big_file_threshold = 512 * 1024 * 1024;
static int force_update;
static int pack_compression_level = Z_DEFAULT_COMPRESSION;
static int pack_compression_seen;
@@ -3206,10 +3205,6 @@ static int git_pack_config(const char *k, const char *v, void *cb)
max_packsize = git_config_ulong(k, v);
return 0;
}
- if (!strcmp(k, "core.bigfilethreshold")) {
- long n = git_config_int(k, v);
- big_file_threshold = 0 < n ? n : 0;
- }
return git_default_config(k, v, cb);
}
diff --git a/git-stash.sh b/git-stash.sh
index a305fb1..07ac323 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -264,7 +264,7 @@ parse_flags_and_rev()
b_tree=
i_tree=
- REV=$(git rev-parse --no-flags --symbolic "$@" 2>/dev/null)
+ REV=$(git rev-parse --no-flags --symbolic "$@") || exit 1
FLAGS=
for opt
@@ -310,16 +310,6 @@ parse_flags_and_rev()
IS_STASH_LIKE=t &&
test "$ref_stash" = "$(git rev-parse --symbolic-full-name "${REV%@*}")" &&
IS_STASH_REF=t
-
- if test "${REV}" != "${REV%{*\}}"
- then
- # maintainers: it would be better if git rev-parse indicated
- # this condition with a non-zero status code but as of 1.7.2.1 it
- # it did not. So, we use non-empty stderr output as a proxy for the
- # condition of interest.
- test -z "$(git rev-parse "$REV" 2>&1 >/dev/null)" || die "$REV does not exist in the stash log"
- fi
-
}
is_stash_like()
@@ -344,9 +334,7 @@ apply_stash () {
assert_stash_like "$@"
- git update-index -q --refresh &&
- git diff-files --quiet --ignore-submodules ||
- die 'Cannot apply to a dirty working tree, please stage your changes'
+ git update-index -q --refresh || die 'unable to refresh index'
# current index state
c_tree=$(git write-tree) ||
diff --git a/git-svn.perl b/git-svn.perl
index bf0451b..0fd2fd2 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -784,6 +784,15 @@ sub cmd_find_rev {
print "$result\n" if $result;
}
+sub auto_create_empty_directories {
+ my ($gs) = @_;
+ my $var = eval { command_oneline('config', '--get', '--bool',
+ "svn-remote.$gs->{repo_id}.automkdirs") };
+ # By default, create empty directories by consulting the unhandled log,
+ # but allow setting it to 'false' to skip it.
+ return !($var && $var eq 'false');
+}
+
sub cmd_rebase {
command_noisy(qw/update-index --refresh/);
my ($url, $rev, $uuid, $gs) = working_head_info('HEAD');
@@ -807,7 +816,9 @@ sub cmd_rebase {
$_fetch_all ? $gs->fetch_all : $gs->fetch;
}
command_noisy(rebase_cmd(), $gs->refname);
- $gs->mkemptydirs;
+ if (auto_create_empty_directories($gs)) {
+ $gs->mkemptydirs;
+ }
}
sub cmd_show_ignore {
@@ -1245,7 +1256,9 @@ sub post_fetch_checkout {
command_noisy(qw/read-tree -m -u -v HEAD HEAD/);
print STDERR "Checked out HEAD:\n ",
$gs->full_url, " r", $gs->last_rev, "\n";
- $gs->mkemptydirs($gs->last_rev);
+ if (auto_create_empty_directories($gs)) {
+ $gs->mkemptydirs($gs->last_rev);
+ }
}
sub complete_svn_url {
diff --git a/gitweb/README b/gitweb/README
index 4a67393..a92bde7 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -29,7 +29,7 @@ You can specify the following configuration variables when building GIT:
The filesystem traversing limit for getting the project list; the number
is taken as depth relative to the projectroot. It is used when
GITWEB_LIST is a directory (or is not set; then project root is used).
- Is is meant to speed up project listing on large work trees by limiting
+ This is meant to speed up project listing on large work trees by limiting
search depth. [Default: 2007]
* GITWEB_LIST
Points to a directory to scan for projects (defaults to project root
diff --git a/graph.c b/graph.c
index ef2e24e..2f6893d 100644
--- a/graph.c
+++ b/graph.c
@@ -59,27 +59,6 @@ enum graph_state {
GRAPH_COLLAPSING
};
-/*
- * The list of available column colors.
- */
-static const char *column_colors_ansi[] = {
- GIT_COLOR_RED,
- GIT_COLOR_GREEN,
- GIT_COLOR_YELLOW,
- GIT_COLOR_BLUE,
- GIT_COLOR_MAGENTA,
- GIT_COLOR_CYAN,
- GIT_COLOR_BOLD_RED,
- GIT_COLOR_BOLD_GREEN,
- GIT_COLOR_BOLD_YELLOW,
- GIT_COLOR_BOLD_BLUE,
- GIT_COLOR_BOLD_MAGENTA,
- GIT_COLOR_BOLD_CYAN,
- GIT_COLOR_RESET,
-};
-
-#define COLUMN_COLORS_ANSI_MAX (ARRAY_SIZE(column_colors_ansi) - 1)
-
static const char **column_colors;
static unsigned short column_colors_max;
@@ -228,7 +207,7 @@ struct git_graph *graph_init(struct rev_info *opt)
if (!column_colors)
graph_set_column_colors(column_colors_ansi,
- COLUMN_COLORS_ANSI_MAX);
+ column_colors_ansi_max);
graph->commit = NULL;
graph->revs = opt;
diff --git a/run-command.c b/run-command.c
index 8619c76..f91e446 100644
--- a/run-command.c
+++ b/run-command.c
@@ -67,26 +67,21 @@ static int child_notifier = -1;
static void notify_parent(void)
{
- /*
- * execvp failed. If possible, we'd like to let start_command
- * know, so failures like ENOENT can be handled right away; but
- * otherwise, finish_command will still report the error.
- */
- if (write(child_notifier, "", 1))
- ; /* yes, dear gcc -D_FORTIFY_SOURCE, there was an error. */
+ ssize_t unused;
+ unused = write(child_notifier, "", 1);
}
static NORETURN void die_child(const char *err, va_list params)
{
char msg[4096];
+ ssize_t unused;
int len = vsnprintf(msg, sizeof(msg), err, params);
if (len > sizeof(msg))
len = sizeof(msg);
- if (write(child_err, "fatal: ", 7) ||
- write(child_err, msg, len) ||
- write(child_err, "\n", 1))
- ; /* yes, gcc -D_FORTIFY_SOURCE, we know there was an error. */
+ unused = write(child_err, "fatal: ", 7);
+ unused = write(child_err, msg, len);
+ unused = write(child_err, "\n", 1);
exit(128);
}
#endif
diff --git a/sha1_file.c b/sha1_file.c
index df0edba..889fe71 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1534,7 +1534,7 @@ static int unpack_object_header(struct packed_git *p,
enum object_type type;
/* use_pack() assures us we have [base, base + 20) available
- * as a range that we can look at at. (Its actually the hash
+ * as a range that we can look at. (Its actually the hash
* size that is assured.) With our object header encoding
* the maximum deflated object size is 2^137, which is just
* insane, so we know won't exceed what we have been given.
diff --git a/sha1_name.c b/sha1_name.c
index faea58d..69cd6c8 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -1012,11 +1012,13 @@ static void diagnose_invalid_sha1_path(const char *prefix,
if (!get_tree_entry(tree_sha1, fullname,
sha1, &mode)) {
die("Path '%s' exists, but not '%s'.\n"
- "Did you mean '%s:%s'?",
+ "Did you mean '%s:%s' aka '%s:./%s'?",
fullname,
filename,
object_name,
- fullname);
+ fullname,
+ object_name,
+ filename);
}
die("Path '%s' does not exist in '%s'",
filename, object_name);
@@ -1065,9 +1067,10 @@ static void diagnose_invalid_index_path(int stage,
if (ce_namelen(ce) == fullnamelen &&
!memcmp(ce->name, fullname, fullnamelen))
die("Path '%s' is in the index, but not '%s'.\n"
- "Did you mean ':%d:%s'?",
+ "Did you mean ':%d:%s' aka ':%d:./%s'?",
fullname, filename,
- ce_stage(ce), fullname);
+ ce_stage(ce), fullname,
+ ce_stage(ce), filename);
}
if (!lstat(filename, &st))
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index a5816d0..54520f6 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -402,7 +402,7 @@ test_expect_success 're-init to move gitdir' '
test -d realgitdir/refs
'
-test_expect_success 're-init to move gitdir symlink' '
+test_expect_success SYMLINKS 're-init to move gitdir symlink' '
rm -rf newdir realgitdir &&
git init newdir &&
(
diff --git a/t/t1411-reflog-show.sh b/t/t1411-reflog-show.sh
index ba25ff3..caa687b 100755
--- a/t/t1411-reflog-show.sh
+++ b/t/t1411-reflog-show.sh
@@ -28,6 +28,24 @@ test_expect_success 'oneline reflog format' '
test_cmp expect actual
'
+test_expect_success 'reflog default format' '
+ git reflog -1 >actual &&
+ test_cmp expect actual
+'
+
+cat >expect <<'EOF'
+commit e46513e
+Reflog: HEAD@{0} (C O Mitter <committer@example.com>)
+Reflog message: commit (initial): one
+Author: A U Thor <author@example.com>
+
+ one
+EOF
+test_expect_success 'override reflog default format' '
+ git reflog --format=short -1 >actual &&
+ test_cmp expect actual
+'
+
cat >expect <<'EOF'
Reflog: HEAD@{Thu Apr 7 15:13:13 2005 -0700} (C O Mitter <committer@example.com>)
Reflog message: commit (initial): one
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 9f8adb1..4a6396f 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -6,6 +6,13 @@ exec </dev/null
. ./test-lib.sh
+test_did_you_mean ()
+{
+ printf "fatal: Path '$2$3' $4, but not ${5:-'$3'}.\n" >expected &&
+ printf "Did you mean '$1:$2$3'${2:+ aka '$1:./$3'}?\n" >>expected &&
+ test_cmp expected error
+}
+
HASH_file=
test_expect_success 'set up basic repo' '
@@ -106,7 +113,7 @@ test_expect_success 'incorrect file in sha1:path' '
grep "fatal: Path '"'"'index-only.txt'"'"' exists on disk, but not in '"'"'HEAD'"'"'." error &&
(cd subdir &&
test_must_fail git rev-parse HEAD:file2.txt 2> error &&
- grep "Did you mean '"'"'HEAD:subdir/file2.txt'"'"'?" error )
+ test_did_you_mean HEAD subdir/ file2.txt exists )
'
test_expect_success 'incorrect file in :path and :N:path' '
@@ -115,14 +122,14 @@ test_expect_success 'incorrect file in :path and :N:path' '
test_must_fail git rev-parse :1:nothing.txt 2> error &&
grep "Path '"'"'nothing.txt'"'"' does not exist (neither on disk nor in the index)." error &&
test_must_fail git rev-parse :1:file.txt 2> error &&
- grep "Did you mean '"'"':0:file.txt'"'"'?" error &&
+ test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" &&
(cd subdir &&
test_must_fail git rev-parse :1:file.txt 2> error &&
- grep "Did you mean '"'"':0:file.txt'"'"'?" error &&
+ test_did_you_mean ":0" "" file.txt "is in the index" "at stage 1" &&
test_must_fail git rev-parse :file2.txt 2> error &&
- grep "Did you mean '"'"':0:subdir/file2.txt'"'"'?" error &&
+ test_did_you_mean ":0" subdir/ file2.txt "is in the index" &&
test_must_fail git rev-parse :2:file2.txt 2> error &&
- grep "Did you mean '"'"':0:subdir/file2.txt'"'"'?" error) &&
+ test_did_you_mean :0 subdir/ file2.txt "is in the index") &&
test_must_fail git rev-parse :disk-only.txt 2> error &&
grep "fatal: Path '"'"'disk-only.txt'"'"' exists on disk, but not in the index." error
'
diff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh
index 27db2ad..5da63e9 100755
--- a/t/t2021-checkout-overwrite.sh
+++ b/t/t2021-checkout-overwrite.sh
@@ -39,7 +39,7 @@ test_expect_success SYMLINKS 'create a commit where dir a/b changed to symlink'
git commit -m "dir to symlink"
'
-test_expect_failure SYMLINKS 'checkout commit with dir must not remove untracked a/b' '
+test_expect_success SYMLINKS 'checkout commit with dir must not remove untracked a/b' '
git rm --cached a/b &&
git commit -m "un-track the symlink" &&
diff --git a/t/t3306-notes-prune.sh b/t/t3306-notes-prune.sh
index c428217..86bf909 100755
--- a/t/t3306-notes-prune.sh
+++ b/t/t3306-notes-prune.sh
@@ -20,6 +20,9 @@ test_expect_success 'setup: create a few commits with notes' '
git add file3 &&
test_tick &&
git commit -m 3rd &&
+ COMMIT_FILE=.git/objects/5e/e1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
+ test -f $COMMIT_FILE &&
+ test-chmtime =+0 $COMMIT_FILE &&
git notes add -m "Note #3"
'
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index f62aaf5..a27d778 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -37,14 +37,32 @@ test_expect_success 'parents of stash' '
test_cmp output expect
'
-test_expect_success 'apply needs clean working directory' '
- echo 4 > other-file &&
+test_expect_success 'applying bogus stash does nothing' '
+ test_must_fail git stash apply stash@{1} &&
+ echo 1 >expect &&
+ test_cmp expect file
+'
+
+test_expect_success 'apply does not need clean working directory' '
+ echo 4 >other-file &&
git add other-file &&
- echo 5 > other-file &&
- test_must_fail git stash apply
+ echo 5 >other-file &&
+ git stash apply &&
+ echo 3 >expect &&
+ test_cmp expect file
+'
+
+test_expect_success 'apply does not clobber working directory changes' '
+ git reset --hard &&
+ echo 4 >file &&
+ test_must_fail git stash apply &&
+ echo 4 >expect &&
+ test_cmp expect file
'
test_expect_success 'apply stashed changes' '
+ git reset --hard &&
+ echo 5 >other-file &&
git add other-file &&
test_tick &&
git commit -m other-file &&
@@ -537,11 +555,11 @@ test_expect_success 'invalid ref of the form stash@{n}, n >= N' '
echo bar6 > file2 &&
git add file2 &&
git stash &&
- test_must_fail git drop stash@{1} &&
- test_must_fail git pop stash@{1} &&
- test_must_fail git apply stash@{1} &&
- test_must_fail git show stash@{1} &&
- test_must_fail git branch tmp stash@{1} &&
+ test_must_fail git stash drop stash@{1} &&
+ test_must_fail git stash pop stash@{1} &&
+ test_must_fail git stash apply stash@{1} &&
+ test_must_fail git stash show stash@{1} &&
+ test_must_fail git stash branch tmp stash@{1} &&
git stash drop
'
diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index e2ed13d..d645328 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -14,7 +14,8 @@ add_blob() {
BLOB=$(echo aleph_0 | git hash-object -w --stdin) &&
BLOB_FILE=.git/objects/$(echo $BLOB | sed "s/^../&\//") &&
test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
- test -f $BLOB_FILE
+ test -f $BLOB_FILE &&
+ test-chmtime =+0 $BLOB_FILE
}
test_expect_success setup '
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 7e1be44..800b536 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -453,4 +453,11 @@ test_expect_success 'git clean -e' '
)
'
+test_expect_success SANITY 'git clean -d with an unreadable empty directory' '
+ mkdir foo &&
+ chmod a= foo &&
+ git clean -dfx foo &&
+ ! test -d foo
+'
+
test_done
diff --git a/t/t9146-git-svn-empty-dirs.sh b/t/t9146-git-svn-empty-dirs.sh
index 158c8e3..6d3130e 100755
--- a/t/t9146-git-svn-empty-dirs.sh
+++ b/t/t9146-git-svn-empty-dirs.sh
@@ -28,6 +28,23 @@ test_expect_success 'empty directories exist' '
)
'
+test_expect_success 'option automkdirs set to false' '
+ (
+ git svn init "$svnrepo" cloned-no-mkdirs &&
+ cd cloned-no-mkdirs &&
+ git config svn-remote.svn.automkdirs false &&
+ git svn fetch &&
+ for i in a b c d d/e d/e/f "weird file name"
+ do
+ if test -d "$i"
+ then
+ echo >&2 "$i exists"
+ exit 1
+ fi
+ done
+ )
+'
+
test_expect_success 'more emptiness' '
svn_cmd mkdir -m "bang bang" "$svnrepo"/"! !"
'
diff --git a/upload-pack.c b/upload-pack.c
index bba053f..ce5cbbe 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -157,15 +157,8 @@ static void create_pack_file(void)
const char *argv[10];
int arg = 0;
- if (shallow_nr) {
- memset(&rev_list, 0, sizeof(rev_list));
- rev_list.proc = do_rev_list;
- rev_list.out = -1;
- if (start_async(&rev_list))
- die("git upload-pack: unable to fork git-rev-list");
- argv[arg++] = "pack-objects";
- } else {
- argv[arg++] = "pack-objects";
+ argv[arg++] = "pack-objects";
+ if (!shallow_nr) {
argv[arg++] = "--revs";
if (create_full_pack)
argv[arg++] = "--all";
@@ -183,7 +176,7 @@ static void create_pack_file(void)
argv[arg++] = NULL;
memset(&pack_objects, 0, sizeof(pack_objects));
- pack_objects.in = shallow_nr ? rev_list.out : -1;
+ pack_objects.in = -1;
pack_objects.out = -1;
pack_objects.err = -1;
pack_objects.git_cmd = 1;
@@ -192,8 +185,14 @@ static void create_pack_file(void)
if (start_command(&pack_objects))
die("git upload-pack: unable to fork git-pack-objects");
- /* pass on revisions we (don't) want */
- if (!shallow_nr) {
+ if (shallow_nr) {
+ memset(&rev_list, 0, sizeof(rev_list));
+ rev_list.proc = do_rev_list;
+ rev_list.out = pack_objects.in;
+ if (start_async(&rev_list))
+ die("git upload-pack: unable to fork git-rev-list");
+ }
+ else {
FILE *pipe_fd = xfdopen(pack_objects.in, "w");
if (!create_full_pack) {
int i;
diff --git a/vcs-svn/trp.txt b/vcs-svn/trp.txt
index 5ca6b42..177ebca 100644
--- a/vcs-svn/trp.txt
+++ b/vcs-svn/trp.txt
@@ -96,7 +96,7 @@ node_type *foo_search(struct trp_root \*treap, node_type \*key)::
node_type *foo_nsearch(struct trp_root \*treap, node_type \*key)::
- Like `foo_search`, but if if the key is missing return what
+ Like `foo_search`, but if the key is missing return what
would be key's successor, were key in treap (NULL if no
successor).