Browse Source

Merge branch 'maint'

* maint:
  Start preparing release notes for 1.5.6.3
  git-submodule - Fix bugs in adding an existing repo as a module
  bash: offer only paths after '--'
  Remove unnecessary pack-*.keep file after successful git-clone
  make deleting a missing ref more quiet
maint
Junio C Hamano 17 years ago
parent
commit
bb293b831b
  1. 42
      Documentation/RelNotes-1.5.6.3.txt
  2. 7
      builtin-clone.c
  3. 3
      builtin-send-pack.c
  4. 30
      contrib/completion/git-completion.bash
  5. 3
      git-submodule.sh
  6. 2
      refs.c
  7. 7
      t/t5404-tracking-branches.sh
  8. 20
      t/t5601-clone.sh

42
Documentation/RelNotes-1.5.6.3.txt

@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
GIT v1.5.6.3 Release Notes
==========================

Fixes since v1.5.6.2
--------------------

* Setting GIT_TRACE will report spawning of external process via run_command().

* Bash completion script did not notice '--' marker on the command
line and tried the relatively slow "ref completion" even when
completing arguments after one.

* Registering a non-empty blob racily and then truncating the working
tree file for it confused "racy-git avoidance" logic into thinking
that the path is now unchanged.

* "git clone" had a leftover debugging fprintf().

* "git clone -q" was not quiet enough as it used to and gave object count
and progress reports.

* "git clone" marked downloaded packfile with .keep; this could be a
good thing if the remote side is well packed but otherwise not,
especially for a project that is not really big.

* The section that describes attributes related to git-archive were placed
in a wrong place in the gitattributes(5) manual page.

* When "git push" tries to remove a remote ref, and corresponding
tracking ref is missing, we used to report error (i.e. failure to
remove something that does not exist).

* "git mailinfo" (hence "git am") did not handle commit log messages in a
MIME multipart mail correctly.

Contains other various documentation fixes.

--
exec >/var/tmp/1
O=v1.5.6.2-23-ge965647
echo O=$(git describe maint)
git shortlog --no-merges $O..maint

7
builtin-clone.c

@ -341,6 +341,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) @@ -341,6 +341,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
const struct ref *refs, *head_points_at, *remote_head, *mapped_refs;
char branch_top[256], key[256], value[256];
struct strbuf reflog_msg;
struct transport *transport = NULL;

struct refspec refspec;

@ -462,8 +463,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix) @@ -462,8 +463,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
refs = clone_local(path, git_dir);
else {
struct remote *remote = remote_get(argv[0]);
struct transport *transport =
transport_get(remote, remote->url[0]);
transport = transport_get(remote, remote->url[0]);

if (!transport->get_refs_list || !transport->fetch)
die("Don't know how to clone %s", transport->url);
@ -533,6 +533,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix) @@ -533,6 +533,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
option_no_checkout = 1;
}

if (transport)
transport_unlock_pack(transport);

if (!option_no_checkout) {
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
struct unpack_trees_options opts;

3
builtin-send-pack.c

@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref) @@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
if (args.verbose)
fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
if (ref->deletion) {
if (delete_ref(rs.dst, NULL))
error("Failed to delete");
delete_ref(rs.dst, NULL);
} else
update_ref("update by push", rs.dst,
ref->new_sha1, NULL, 0, 0);

30
contrib/completion/git-completion.bash

@ -451,6 +451,18 @@ __git_find_subcommand () @@ -451,6 +451,18 @@ __git_find_subcommand ()
done
}

__git_has_doubledash ()
{
local c=1
while [ $c -lt $COMP_CWORD ]; do
if [ "--" = "${COMP_WORDS[c]}" ]; then
return 0
fi
c=$((++c))
done
return 1
}

__git_whitespacelist="nowarn warn error error-all strip"

_git_am ()
@ -497,6 +509,8 @@ _git_apply () @@ -497,6 +509,8 @@ _git_apply ()

_git_add ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@ -511,6 +525,8 @@ _git_add () @@ -511,6 +525,8 @@ _git_add ()

_git_bisect ()
{
__git_has_doubledash && return

local subcommands="start bad good skip reset visualize replay log run"
local subcommand="$(__git_find_subcommand "$subcommands")"
if [ -z "$subcommand" ]; then
@ -613,6 +629,8 @@ _git_cherry_pick () @@ -613,6 +629,8 @@ _git_cherry_pick ()

_git_commit ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@ -632,6 +650,8 @@ _git_describe () @@ -632,6 +650,8 @@ _git_describe ()

_git_diff ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@ -734,6 +754,8 @@ _git_ls_tree () @@ -734,6 +754,8 @@ _git_ls_tree ()

_git_log ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
@ -1086,6 +1108,8 @@ _git_remote () @@ -1086,6 +1108,8 @@ _git_remote ()

_git_reset ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@ -1098,6 +1122,8 @@ _git_reset () @@ -1098,6 +1122,8 @@ _git_reset ()

_git_shortlog ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
@ -1144,6 +1170,8 @@ _git_stash () @@ -1144,6 +1170,8 @@ _git_stash ()

_git_submodule ()
{
__git_has_doubledash && return

local subcommands="add status init update"
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
local cur="${COMP_WORDS[COMP_CWORD]}"
@ -1350,6 +1378,8 @@ _git () @@ -1350,6 +1378,8 @@ _git ()

_gitk ()
{
__git_has_doubledash && return

local cur="${COMP_WORDS[COMP_CWORD]}"
local g="$(git rev-parse --git-dir 2>/dev/null)"
local merge=""

3
git-submodule.sh

@ -167,8 +167,7 @@ cmd_add() @@ -167,8 +167,7 @@ cmd_add()
# perhaps the path exists and is already a git repo, else clone it
if test -e "$path"
then
if test -d "$path/.git" &&
test "$(unset GIT_DIR; cd $path; git rev-parse --git-dir)" = ".git"
if test -d "$path"/.git -o -f "$path"/.git
then
echo "Adding existing repo at '$path' to the index"
else

2
refs.c

@ -925,7 +925,7 @@ int delete_ref(const char *refname, const unsigned char *sha1) @@ -925,7 +925,7 @@ int delete_ref(const char *refname, const unsigned char *sha1)
i = strlen(lock->lk->filename) - 5; /* .lock */
lock->lk->filename[i] = 0;
err = unlink(lock->lk->filename);
if (err) {
if (err && errno != ENOENT) {
ret = 1;
error("unlink(%s) failed: %s",
lock->lk->filename, strerror(errno));

7
t/t5404-tracking-branches.sh

@ -10,6 +10,7 @@ test_expect_success 'setup' ' @@ -10,6 +10,7 @@ test_expect_success 'setup' '
git commit -m 1 &&
git branch b1 &&
git branch b2 &&
git branch b3 &&
git clone . aa &&
git checkout b1 &&
echo b1 >>file &&
@ -50,4 +51,10 @@ test_expect_success 'deleted branches have their tracking branches removed' ' @@ -50,4 +51,10 @@ test_expect_success 'deleted branches have their tracking branches removed' '
test "$(git rev-parse origin/b1)" = "origin/b1"
'

test_expect_success 'already deleted tracking branches ignored' '
git branch -d -r origin/b3 &&
git push origin :b3 >output 2>&1 &&
! grep error output
'

test_done

20
t/t5601-clone.sh

@ -17,14 +17,32 @@ test_expect_success setup ' @@ -17,14 +17,32 @@ test_expect_success setup '

'

test_expect_success 'clone with excess parameters' '
test_expect_success 'clone with excess parameters (1)' '

rm -fr dst &&
test_must_fail git clone -n src dst junk

'

test_expect_success 'clone with excess parameters (2)' '

rm -fr dst &&
test_must_fail git clone -n "file://$(pwd)/src" dst junk

'

test_expect_success 'clone does not keep pack' '

rm -fr dst &&
git clone -n "file://$(pwd)/src" dst &&
! test -f dst/file &&
! (echo dst/.git/objects/pack/pack-* | grep "\.keep")

'

test_expect_success 'clone checks out files' '

rm -fr dst &&
git clone src dst &&
test -f dst/file


Loading…
Cancel
Save