Skip to content

Commit aa8d53e

Browse files
committed
Merge branch 'maint'
* maint: config: add test cases for empty value and no value config variables. cvsimport: have default merge regex also match beginning of commit message git clone -s documentation: force a new paragraph for the NOTE status: suggest "git rm --cached" to unstage for initial commit Protect get_author_ident_from_commit() from filenames in work tree upload-pack: Initialize the exec-path. bisect: use verbatim commit subject in the bisect log git-cvsimport.txt: fix '-M' description. Revert "pack-objects: only throw away data during memory pressure"
2 parents 41e2edf + d8e8757 commit aa8d53e

10 files changed

+50
-24
lines changed

Documentation/git-clone.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ OPTIONS
6262
.git/objects/info/alternates to share the objects
6363
with the source repository. The resulting repository
6464
starts out without any object of its own.
65-
*NOTE*: this is a possibly dangerous operation; do *not* use
66-
it unless you understand what it does. If you clone your
67-
repository using this option, then delete branches in the
68-
source repository and then run linkgit:git-gc[1] using the
69-
'--prune' option in the source repository, it may remove
70-
objects which are referenced by the cloned repository.
65+
+
66+
*NOTE*: this is a possibly dangerous operation; do *not* use
67+
it unless you understand what it does. If you clone your
68+
repository using this option, then delete branches in the
69+
source repository and then run linkgit:git-gc[1] using the
70+
'--prune' option in the source repository, it may remove
71+
objects which are referenced by the cloned repository.
7172

7273

7374

Documentation/git-cvsimport.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ If you need to pass multiple options, separate them with a comma.
107107

108108
-M <regex>::
109109
Attempt to detect merges based on the commit message with a custom
110-
regex. It can be used with '-m' to also see the default regexes.
111-
You must escape forward slashes.
110+
regex. It can be used with '-m' to enable the default regexes
111+
as well. You must escape forward slashes.
112112

113113
-S <regex>::
114114
Skip paths matching the regex.

builtin-pack-objects.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n)
14641464
return m;
14651465
}
14661466

1467-
static unsigned long free_unpacked_data(struct unpacked *n)
1467+
static unsigned long free_unpacked(struct unpacked *n)
14681468
{
14691469
unsigned long freed_mem = sizeof_delta_index(n->index);
14701470
free_delta_index(n->index);
@@ -1474,12 +1474,6 @@ static unsigned long free_unpacked_data(struct unpacked *n)
14741474
free(n->data);
14751475
n->data = NULL;
14761476
}
1477-
return freed_mem;
1478-
}
1479-
1480-
static unsigned long free_unpacked(struct unpacked *n)
1481-
{
1482-
unsigned long freed_mem = free_unpacked_data(n);
14831477
n->entry = NULL;
14841478
n->depth = 0;
14851479
return freed_mem;
@@ -1520,7 +1514,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
15201514
mem_usage > window_memory_limit &&
15211515
count > 1) {
15221516
uint32_t tail = (idx + window - count) % window;
1523-
mem_usage -= free_unpacked_data(array + tail);
1517+
mem_usage -= free_unpacked(array + tail);
15241518
count--;
15251519
}
15261520

@@ -1553,9 +1547,6 @@ static void find_deltas(struct object_entry **list, unsigned *list_size,
15531547
if (!m->entry)
15541548
break;
15551549
ret = try_delta(n, m, max_depth, &mem_usage);
1556-
if (window_memory_limit &&
1557-
mem_usage > window_memory_limit)
1558-
mem_usage -= free_unpacked_data(m);
15591550
if (ret < 0)
15601551
break;
15611552
else if (ret > 0)

git-bisect.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ bisect_write() {
135135
*) die "Bad bisect_write argument: $state" ;;
136136
esac
137137
git update-ref "refs/bisect/$tag" "$rev"
138-
echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG"
138+
echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG"
139139
test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG"
140140
}
141141

git-cvsimport.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ sub read_repo_config {
164164

165165
our @mergerx = ();
166166
if ($opt_m) {
167-
@mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i );
167+
@mergerx = ( qr/\b(?:from|of|merge|merging|merged) (\w+)/i );
168168
}
169169
if ($opt_M) {
170170
push (@mergerx, qr/$opt_M/);

git-sh-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ get_author_ident_from_commit () {
119119
}
120120
'
121121
encoding=$(git config i18n.commitencoding || echo UTF-8)
122-
git show -s --pretty=raw --encoding="$encoding" "$1" |
122+
git show -s --pretty=raw --encoding="$encoding" "$1" -- |
123123
LANG=C LC_ALL=C sed -ne "$pick_author_script"
124124
}
125125

t/t3404-rebase-interactive.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,26 @@ test_expect_success 'rebase a commit violating pre-commit' '
340340
341341
'
342342

343+
test_expect_success 'rebase with a file named HEAD in worktree' '
344+
345+
rm -fr .git/hooks &&
346+
git reset --hard &&
347+
git checkout -b branch3 A &&
348+
349+
(
350+
GIT_AUTHOR_NAME="Squashed Away" &&
351+
export GIT_AUTHOR_NAME &&
352+
>HEAD &&
353+
git add HEAD &&
354+
git commit -m "Add head" &&
355+
>BODY &&
356+
git add BODY &&
357+
git commit -m "Add body"
358+
) &&
359+
360+
FAKE_LINES="1 squash 2" git rebase -i to-be-rebased &&
361+
test "$(git show -s --pretty=format:%an)" = "Squashed Away"
362+
363+
'
364+
343365
test_done

t/t7502-status.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ test_expect_success 'setup' '
1717
: > dir1/tracked &&
1818
: > dir1/modified &&
1919
git add . &&
20+
21+
git status >output &&
22+
2023
test_tick &&
2124
git commit -m initial &&
2225
: > untracked &&
@@ -28,6 +31,12 @@ test_expect_success 'setup' '
2831
git add dir2/added
2932
'
3033

34+
test_expect_success 'status (1)' '
35+
36+
grep -e "use \"git rm --cached <file>\.\.\.\" to unstage" output
37+
38+
'
39+
3140
cat > expect << \EOF
3241
# On branch master
3342
# Changes to be committed:
@@ -51,7 +60,7 @@ cat > expect << \EOF
5160
# untracked
5261
EOF
5362

54-
test_expect_success 'status' '
63+
test_expect_success 'status (2)' '
5564
5665
git status > output &&
5766
git diff expect output

upload-pack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,9 @@ int main(int argc, char **argv)
620620

621621
if (i != argc-1)
622622
usage(upload_pack_usage);
623+
624+
setup_path(NULL);
625+
623626
dir = argv[i];
624627

625628
if (!enter_repo(dir, strict))

wt-status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void wt_status_print_cached_header(struct wt_status *s)
6060
{
6161
const char *c = color(WT_STATUS_HEADER);
6262
color_fprintf_ln(s->fp, c, "# Changes to be committed:");
63-
if (s->reference) {
63+
if (!s->is_initial) {
6464
color_fprintf_ln(s->fp, c, "# (use \"git reset %s <file>...\" to unstage)", s->reference);
6565
} else {
6666
color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)");

0 commit comments

Comments
 (0)