diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-02-14 01:33:19 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-02-14 01:33:19 +0300 |
commit | aa8d53ec387a7baf72ab5e3a91c35bb5bf20eb4d (patch) | |
tree | 8e9410d69333688d32ccab097beaa48b10850833 | |
parent | 41e2edf41a6d501f1b8beca7f1f0bcbe9296dcc2 (diff) | |
parent | d8e87570c32b190af3991d180f37adb8cf5eb99c (diff) |
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"
-rw-r--r-- | Documentation/git-clone.txt | 13 | ||||
-rw-r--r-- | Documentation/git-cvsimport.txt | 4 | ||||
-rw-r--r-- | builtin-pack-objects.c | 13 | ||||
-rwxr-xr-x | git-bisect.sh | 2 | ||||
-rwxr-xr-x | git-cvsimport.perl | 2 | ||||
-rwxr-xr-x | git-sh-setup.sh | 2 | ||||
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 22 | ||||
-rwxr-xr-x | t/t7502-status.sh | 11 | ||||
-rw-r--r-- | upload-pack.c | 3 | ||||
-rw-r--r-- | wt-status.c | 2 |
10 files changed, 50 insertions, 24 deletions
diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index 2341881614..975824301a 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 dbce503694..6f91b9ea2a 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 <regex>:: 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 <regex>:: Skip paths matching the regex. diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c index acb05554d4..692a76126b 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 393fa35584..6594a62919 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 5694978c46..9516242338 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -164,7 +164,7 @@ if ($#ARGV == 0) { 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 aae14090bd..f38827529f 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 e33ea4e9f4..e5ed74545b 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 9ce50cade8..b64ce30ff1 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 <file>\.\.\.\" 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 7e04311027..51e3ec49d1 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 f14022f2a9..0b060934e2 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 <file>...\" to unstage)", s->reference); } else { color_fprintf_ln(s->fp, c, "# (use \"git rm --cached <file>...\" to unstage)"); |