diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 23418816146d0b65eeabdd7a3d67dcd7e8c760e1..975824301a45bfa297f2ecd5c19e429cb9c86c65 100644 --- a/Documentation/git-clone.txt +++ b/Documentation/git-clone.txt @@ -62,12 +62,13 @@ OPTIONS .git/objects/info/alternates to share the objects with the source repository. The resulting repository starts out without any object of its own. - *NOTE*: this is a possibly dangerous operation; do *not* use - it unless you understand what it does. If you clone your - repository using this option, then delete branches in the - source repository and then run linkgit:git-gc[1] using the - '--prune' option in the source repository, it may remove - objects which are referenced by the cloned repository. ++ +*NOTE*: this is a possibly dangerous operation; do *not* use +it unless you understand what it does. If you clone your +repository using this option, then delete branches in the +source repository and then run linkgit:git-gc[1] using the +'--prune' option in the source repository, it may remove +objects which are referenced by the cloned repository. diff --git a/Documentation/git-cvsimport.txt b/Documentation/git-cvsimport.txt index dbce503694049ced5232423ffa11bb9a896e3c52..6f91b9ea2a17df8fc8e3c00fdf0d5c74a6c17950 100644 --- a/Documentation/git-cvsimport.txt +++ b/Documentation/git-cvsimport.txt @@ -107,8 +107,8 @@ If you need to pass multiple options, separate them with a comma. -M :: Attempt to detect merges based on the commit message with a custom - regex. It can be used with '-m' to also see the default regexes. - You must escape forward slashes. + regex. It can be used with '-m' to enable the default regexes + as well. You must escape forward slashes. -S :: Skip paths matching the regex. diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index acb05554d499598677bc1f0cec3b6ff37e796d88..692a76126b027133fd046f03003fe8e49218f192 100644 --- a/builtin-pack-objects.c +++ b/builtin-pack-objects.c @@ -1464,7 +1464,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n) return m; } -static unsigned long free_unpacked_data(struct unpacked *n) +static unsigned long free_unpacked(struct unpacked *n) { unsigned long freed_mem = sizeof_delta_index(n->index); free_delta_index(n->index); @@ -1474,12 +1474,6 @@ static unsigned long free_unpacked_data(struct unpacked *n) free(n->data); n->data = NULL; } - return freed_mem; -} - -static unsigned long free_unpacked(struct unpacked *n) -{ - unsigned long freed_mem = free_unpacked_data(n); n->entry = NULL; n->depth = 0; return freed_mem; @@ -1520,7 +1514,7 @@ static void find_deltas(struct object_entry **list, unsigned *list_size, mem_usage > window_memory_limit && count > 1) { uint32_t tail = (idx + window - count) % window; - mem_usage -= free_unpacked_data(array + tail); + mem_usage -= free_unpacked(array + tail); count--; } @@ -1553,9 +1547,6 @@ static void find_deltas(struct object_entry **list, unsigned *list_size, if (!m->entry) break; ret = try_delta(n, m, max_depth, &mem_usage); - if (window_memory_limit && - mem_usage > window_memory_limit) - mem_usage -= free_unpacked_data(m); if (ret < 0) break; else if (ret > 0) diff --git a/git-bisect.sh b/git-bisect.sh index 393fa355849f88d6c5227f90cbf6cbb45b39631e..6594a62919adcf2d1c524cc24435b6fe444f9d52 100755 --- a/git-bisect.sh +++ b/git-bisect.sh @@ -135,7 +135,7 @@ bisect_write() { *) die "Bad bisect_write argument: $state" ;; esac git update-ref "refs/bisect/$tag" "$rev" - echo "# $state: "$(git show-branch $rev) >>"$GIT_DIR/BISECT_LOG" + echo "# $state: $(git show-branch $rev)" >>"$GIT_DIR/BISECT_LOG" test -z "$nolog" && echo "git-bisect $state $rev" >>"$GIT_DIR/BISECT_LOG" } diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 5694978c466df8e97483b5bdf5e9ae00b481c56c..9516242338d95687b4354a6d21692cbd10547899 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -164,7 +164,7 @@ sub read_repo_config { our @mergerx = (); if ($opt_m) { - @mergerx = ( qr/\W(?:from|of|merge|merging|merged) (\w+)/i ); + @mergerx = ( qr/\b(?:from|of|merge|merging|merged) (\w+)/i ); } if ($opt_M) { push (@mergerx, qr/$opt_M/); diff --git a/git-sh-setup.sh b/git-sh-setup.sh index aae14090bd884920c7b5cb7530db66719df98ddd..f38827529f2fd60743f5571948742fada975cf93 100755 --- a/git-sh-setup.sh +++ b/git-sh-setup.sh @@ -119,7 +119,7 @@ get_author_ident_from_commit () { } ' encoding=$(git config i18n.commitencoding || echo UTF-8) - git show -s --pretty=raw --encoding="$encoding" "$1" | + git show -s --pretty=raw --encoding="$encoding" "$1" -- | LANG=C LC_ALL=C sed -ne "$pick_author_script" } diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index e33ea4e9f4c33cc1f94cd184c371a8fa05bedf3b..e5ed74545b8a2ac9c2063b2ae40d7c661bda0260 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -340,4 +340,26 @@ test_expect_success 'rebase a commit violating pre-commit' ' ' +test_expect_success 'rebase with a file named HEAD in worktree' ' + + rm -fr .git/hooks && + git reset --hard && + git checkout -b branch3 A && + + ( + GIT_AUTHOR_NAME="Squashed Away" && + export GIT_AUTHOR_NAME && + >HEAD && + git add HEAD && + git commit -m "Add head" && + >BODY && + git add BODY && + git commit -m "Add body" + ) && + + FAKE_LINES="1 squash 2" git rebase -i to-be-rebased && + test "$(git show -s --pretty=format:%an)" = "Squashed Away" + +' + test_done diff --git a/t/t7502-status.sh b/t/t7502-status.sh index 9ce50cade8981bb5317397c10b0fabeba4893fc8..b64ce30ff1c28a44b24eb6dd07a2cd9e260e0326 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -17,6 +17,9 @@ test_expect_success 'setup' ' : > dir1/tracked && : > dir1/modified && git add . && + + git status >output && + test_tick && git commit -m initial && : > untracked && @@ -28,6 +31,12 @@ test_expect_success 'setup' ' git add dir2/added ' +test_expect_success 'status (1)' ' + + grep -e "use \"git rm --cached \.\.\.\" to unstage" output + +' + cat > expect << \EOF # On branch master # Changes to be committed: @@ -51,7 +60,7 @@ cat > expect << \EOF # untracked EOF -test_expect_success 'status' ' +test_expect_success 'status (2)' ' git status > output && git diff expect output diff --git a/upload-pack.c b/upload-pack.c index 7e04311027176fc87c1de7dd619000d2a75d4eb9..51e3ec49d120f2e5a095cde45eb0a22bb7e624da 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -620,6 +620,9 @@ int main(int argc, char **argv) if (i != argc-1) usage(upload_pack_usage); + + setup_path(NULL); + dir = argv[i]; if (!enter_repo(dir, strict)) diff --git a/wt-status.c b/wt-status.c index f14022f2a9b8ce740067f7c6bf03bd51203cf2ca..0b060934e218f1d6fb95777ea7dd7faef1c2dd93 100644 --- a/wt-status.c +++ b/wt-status.c @@ -60,7 +60,7 @@ static void wt_status_print_cached_header(struct wt_status *s) { const char *c = color(WT_STATUS_HEADER); color_fprintf_ln(s->fp, c, "# Changes to be committed:"); - if (s->reference) { + if (!s->is_initial) { color_fprintf_ln(s->fp, c, "# (use \"git reset %s ...\" to unstage)", s->reference); } else { color_fprintf_ln(s->fp, c, "# (use \"git rm --cached ...\" to unstage)");