Browse Source

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"
maint
Junio C Hamano 17 years ago
parent
commit
aa8d53ec38
  1. 13
      Documentation/git-clone.txt
  2. 4
      Documentation/git-cvsimport.txt
  3. 13
      builtin-pack-objects.c
  4. 2
      git-bisect.sh
  5. 2
      git-cvsimport.perl
  6. 2
      git-sh-setup.sh
  7. 22
      t/t3404-rebase-interactive.sh
  8. 11
      t/t7502-status.sh
  9. 3
      upload-pack.c
  10. 2
      wt-status.c

13
Documentation/git-clone.txt

@ -62,12 +62,13 @@ OPTIONS @@ -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.




4
Documentation/git-cvsimport.txt

@ -107,8 +107,8 @@ If you need to pass multiple options, separate them with a comma. @@ -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.

13
builtin-pack-objects.c

@ -1464,7 +1464,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n) @@ -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) @@ -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, @@ -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, @@ -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)

2
git-bisect.sh

@ -135,7 +135,7 @@ bisect_write() { @@ -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"
}


2
git-cvsimport.perl

@ -164,7 +164,7 @@ if ($#ARGV == 0) { @@ -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/);

2
git-sh-setup.sh

@ -119,7 +119,7 @@ get_author_ident_from_commit () { @@ -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"
}


22
t/t3404-rebase-interactive.sh

@ -340,4 +340,26 @@ test_expect_success 'rebase a commit violating pre-commit' ' @@ -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

11
t/t7502-status.sh

@ -17,6 +17,9 @@ test_expect_success 'setup' ' @@ -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' ' @@ -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 @@ -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

3
upload-pack.c

@ -620,6 +620,9 @@ int main(int argc, char **argv) @@ -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))

2
wt-status.c

@ -60,7 +60,7 @@ static void wt_status_print_cached_header(struct wt_status *s) @@ -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)");

Loading…
Cancel
Save