Skip to content

Commit 276328f

Browse files
committed
Merge branch 'maint'
* maint: Update release notes for 1.6.0.3 Teach rebase -i to honor pre-rebase hook docs: describe pre-rebase hook do not segfault if make_cache_entry failed make prefix_path() never return NULL fix bogus "diff --git" header from "diff --no-index" Fix fetch/clone --quiet when stdout is connected builtin-blame: Fix blame -C -C with submodules. bash: remove fetch, push, pull dashed form leftovers Conflicts: diff.c
2 parents 048f276 + e261cf9 commit 276328f

File tree

11 files changed

+246
-44
lines changed

11 files changed

+246
-44
lines changed

Documentation/RelNotes-1.6.0.3.txt

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,33 +13,83 @@ Fixes since v1.6.0.2
1313
* Continuing "git rebase -i" was also very confused when the user left
1414
some staged changes in the index after "edit".
1515

16+
* "git rebase -i" now honors the pre-rebase hook, just like the
17+
other rebase implementations "git rebase" and "git rebase -m".
18+
1619
* Behaviour of "git diff --quiet" was inconsistent with "diff --exit-code"
1720
with the output redirected to /dev/null.
1821

22+
* "git diff --no-index" on binary files no longer outputs a bogus
23+
"diff --git" header line.
24+
25+
* Hunk headers in "git diff" default to using extended regular
26+
expressions, fixing some of the internal patterns on non-GNU
27+
platforms.
28+
29+
* New config "diff.*.xfuncname" exposes extended regular expressions
30+
for user specified hunk header patterns.
31+
1932
* "git stash apply sash@{1}" was fixed to error out. Prior versions
2033
would have applied stash@{0} incorrectly.
2134

35+
* "git stash apply" now offers a better suggestion on how to continue
36+
if the working tree is currently dirty.
37+
2238
* "git for-each-ref --format=%(subject)" fixed for commits with no
2339
no newline in the message body.
2440

2541
* "git remote" fixed to protect printf from user input.
2642

43+
* "git remote show -v" now displays all URLs of a remote.
44+
2745
* "git checkout -q" once again suppresses the locally modified file list.
2846

47+
* "git clone -q", "git fetch -q" asks remote side to not send
48+
progress messages, actually making their output quiet.
49+
2950
* Cross-directory renames are no longer used when creating packs. This
3051
allows more graceful behavior on filesystems like sshfs.
3152

3253
* Stale temporary files under $GIT_DIR/objects/pack are now cleaned up
3354
automatically by "git prune".
3455

56+
* "git merge" once agrain removes directories after the last file has
57+
been removed from it during the merge.
58+
59+
* "git blame -C -C" no longer segfaults while trying to pass blame if
60+
it encounters a submodule reference.
61+
62+
* "git svn" fixed to display an error message when 'set-tree' failed,
63+
instead of a Perl compile error.
64+
65+
* "git submodule" fixed to handle checking out a different commit
66+
than HEAD after initializing the submodule.
67+
68+
* The "git commit" error message when there are still unmerged
69+
files present was clarified to match "git write-tree".
70+
71+
* Some segfaults due to uncaught NULL pointers were fixed multiple
72+
tools such as apply, reset, update-index.
73+
74+
* Solaris bulds now default to OLD_ICONV=1 to avoid compile warnings.
75+
3576
* "Git.pm" tests relied on unnecessarily more recent version of Perl.
3677

3778
* "gitweb" triggered undef warning on commits without log messages.
3879

80+
* "gitweb" triggered undef warnings on missing trees.
81+
82+
* "gitweb" now removes PATH_INFO from its URLs so users don't have
83+
to manually set the url in the gitweb configuration.
84+
85+
* Bash completion removed support for legacy "git-fetch", "git-push"
86+
and "git-pull" as these are no longer installed. Dashless form
87+
("git fetch") is still however supported.
88+
3989
Many other documentation updates.
4090

4191
--
4292
exec >/var/tmp/1
43-
O=v1.6.0.2-41-g7fe4a72
93+
O=v1.6.0.2-76-gd70b4a8
4494
echo O=$(git describe maint)
4595
git shortlog --no-merges $O..maint

Documentation/githooks.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ parameter, and is invoked after a commit is made.
130130
This hook is meant primarily for notification, and cannot affect
131131
the outcome of 'git-commit'.
132132

133+
pre-rebase
134+
----------
135+
136+
This hook is called by 'git-rebase' and can be used to prevent a branch
137+
from getting rebased.
138+
139+
133140
post-checkout
134141
-----------
135142

builtin-blame.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ static int find_copy_in_parent(struct scoreboard *sb,
11321132

11331133
if (!DIFF_FILE_VALID(p->one))
11341134
continue; /* does not exist in parent */
1135+
if (S_ISGITLINK(p->one->mode))
1136+
continue; /* ignore git links */
11351137
if (porigin && !strcmp(p->one->path, porigin->path))
11361138
/* find_move already dealt with this path */
11371139
continue;

contrib/completion/git-completion.bash

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -785,14 +785,9 @@ _git_fetch ()
785785
{
786786
local cur="${COMP_WORDS[COMP_CWORD]}"
787787

788-
case "${COMP_WORDS[0]},$COMP_CWORD" in
789-
git-fetch*,1)
788+
if [ "$COMP_CWORD" = 2 ]; then
790789
__gitcomp "$(__git_remotes)"
791-
;;
792-
git,2)
793-
__gitcomp "$(__git_remotes)"
794-
;;
795-
*)
790+
else
796791
case "$cur" in
797792
*:*)
798793
local pfx=""
@@ -811,8 +806,7 @@ _git_fetch ()
811806
__gitcomp "$(__git_refs2 "$remote")"
812807
;;
813808
esac
814-
;;
815-
esac
809+
fi
816810
}
817811

818812
_git_format_patch ()
@@ -1049,36 +1043,25 @@ _git_pull ()
10491043
{
10501044
local cur="${COMP_WORDS[COMP_CWORD]}"
10511045

1052-
case "${COMP_WORDS[0]},$COMP_CWORD" in
1053-
git-pull*,1)
1054-
__gitcomp "$(__git_remotes)"
1055-
;;
1056-
git,2)
1046+
if [ "$COMP_CWORD" = 2 ]; then
10571047
__gitcomp "$(__git_remotes)"
1058-
;;
1059-
*)
1048+
else
10601049
local remote
10611050
case "${COMP_WORDS[0]}" in
10621051
git-pull) remote="${COMP_WORDS[1]}" ;;
10631052
git) remote="${COMP_WORDS[2]}" ;;
10641053
esac
10651054
__gitcomp "$(__git_refs "$remote")"
1066-
;;
1067-
esac
1055+
fi
10681056
}
10691057

10701058
_git_push ()
10711059
{
10721060
local cur="${COMP_WORDS[COMP_CWORD]}"
10731061

1074-
case "${COMP_WORDS[0]},$COMP_CWORD" in
1075-
git-push*,1)
1076-
__gitcomp "$(__git_remotes)"
1077-
;;
1078-
git,2)
1062+
if [ "$COMP_CWORD" = 2 ]; then
10791063
__gitcomp "$(__git_remotes)"
1080-
;;
1081-
*)
1064+
else
10821065
case "$cur" in
10831066
*:*)
10841067
local remote
@@ -1102,8 +1085,7 @@ _git_push ()
11021085
__gitcomp "$(__git_refs)"
11031086
;;
11041087
esac
1105-
;;
1106-
esac
1088+
fi
11071089
}
11081090

11091091
_git_rebase ()

diff.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,6 +1509,10 @@ static void builtin_diff(const char *name_a,
15091509
b_prefix = o->b_prefix;
15101510
}
15111511

1512+
/* Never use a non-valid filename anywhere if at all possible */
1513+
name_a = DIFF_FILE_VALID(one) ? name_a : name_b;
1514+
name_b = DIFF_FILE_VALID(two) ? name_b : name_a;
1515+
15121516
a_one = quote_two(a_prefix, name_a + (*name_a == '/'));
15131517
b_two = quote_two(b_prefix, name_b + (*name_b == '/'));
15141518
lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";

git-rebase--interactive.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,16 @@ output () {
6565
esac
6666
}
6767

68+
run_pre_rebase_hook () {
69+
if test -x "$GIT_DIR/hooks/pre-rebase"
70+
then
71+
"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
72+
echo >&2 "The pre-rebase hook refused to rebase."
73+
exit 1
74+
}
75+
fi
76+
}
77+
6878
require_clean_work_tree () {
6979
# test if working tree is dirty
7080
git rev-parse --verify HEAD > /dev/null &&
@@ -507,6 +517,7 @@ first and then run 'git rebase --continue' again."
507517
;;
508518
--)
509519
shift
520+
run_pre_rebase_hook ${1+"$@"}
510521
test $# -eq 1 -o $# -eq 2 || usage
511522
test -d "$DOTEST" &&
512523
die "Interactive rebase already started"

git-rebase.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ is_interactive () {
144144
done && test -n "$1"
145145
}
146146

147+
run_pre_rebase_hook () {
148+
if test -x "$GIT_DIR/hooks/pre-rebase"
149+
then
150+
"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
151+
echo >&2 "The pre-rebase hook refused to rebase."
152+
exit 1
153+
}
154+
fi
155+
}
156+
147157
test -f "$GIT_DIR"/rebase-apply/applying &&
148158
die 'It looks like git-am is in progress. Cannot rebase.'
149159

@@ -320,13 +330,7 @@ onto_name=${newbase-"$upstream_name"}
320330
onto=$(git rev-parse --verify "${onto_name}^0") || exit
321331

322332
# If a hook exists, give it a chance to interrupt
323-
if test -x "$GIT_DIR/hooks/pre-rebase"
324-
then
325-
"$GIT_DIR/hooks/pre-rebase" ${1+"$@"} || {
326-
echo >&2 "The pre-rebase hook refused to rebase."
327-
exit 1
328-
}
329-
fi
333+
run_pre_rebase_hook ${1+"$@"}
330334

331335
# If the branch to rebase is given, that is the branch we will rebase
332336
# $branch_name -- branch being rebased, or HEAD (already detached)

setup.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
110110
if (strncmp(sanitized, work_tree, len) ||
111111
(sanitized[len] != '\0' && sanitized[len] != '/')) {
112112
error_out:
113-
error("'%s' is outside repository", orig);
114-
free(sanitized);
115-
return NULL;
113+
die("'%s' is outside repository", orig);
116114
}
117115
if (sanitized[len] == '/')
118116
len++;
@@ -216,10 +214,7 @@ const char **get_pathspec(const char *prefix, const char **pathspec)
216214
prefixlen = prefix ? strlen(prefix) : 0;
217215
while (*src) {
218216
const char *p = prefix_path(prefix, prefixlen, *src);
219-
if (p)
220-
*(dst++) = p;
221-
else
222-
exit(128); /* error message already given */
217+
*(dst++) = p;
223218
src++;
224219
}
225220
*dst = NULL;

0 commit comments

Comments
 (0)