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
This commit is contained in:
commit
bb293b831b
42
Documentation/RelNotes-1.5.6.3.txt
Normal file
42
Documentation/RelNotes-1.5.6.3.txt
Normal file
@ -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
|
@ -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;
|
const struct ref *refs, *head_points_at, *remote_head, *mapped_refs;
|
||||||
char branch_top[256], key[256], value[256];
|
char branch_top[256], key[256], value[256];
|
||||||
struct strbuf reflog_msg;
|
struct strbuf reflog_msg;
|
||||||
|
struct transport *transport = NULL;
|
||||||
|
|
||||||
struct refspec refspec;
|
struct refspec refspec;
|
||||||
|
|
||||||
@ -462,8 +463,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
|
|||||||
refs = clone_local(path, git_dir);
|
refs = clone_local(path, git_dir);
|
||||||
else {
|
else {
|
||||||
struct remote *remote = remote_get(argv[0]);
|
struct remote *remote = remote_get(argv[0]);
|
||||||
struct transport *transport =
|
transport = transport_get(remote, remote->url[0]);
|
||||||
transport_get(remote, remote->url[0]);
|
|
||||||
|
|
||||||
if (!transport->get_refs_list || !transport->fetch)
|
if (!transport->get_refs_list || !transport->fetch)
|
||||||
die("Don't know how to clone %s", transport->url);
|
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)
|
|||||||
option_no_checkout = 1;
|
option_no_checkout = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (transport)
|
||||||
|
transport_unlock_pack(transport);
|
||||||
|
|
||||||
if (!option_no_checkout) {
|
if (!option_no_checkout) {
|
||||||
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
|
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
|
||||||
struct unpack_trees_options opts;
|
struct unpack_trees_options opts;
|
||||||
|
@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
|
|||||||
if (args.verbose)
|
if (args.verbose)
|
||||||
fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
|
fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
|
||||||
if (ref->deletion) {
|
if (ref->deletion) {
|
||||||
if (delete_ref(rs.dst, NULL))
|
delete_ref(rs.dst, NULL);
|
||||||
error("Failed to delete");
|
|
||||||
} else
|
} else
|
||||||
update_ref("update by push", rs.dst,
|
update_ref("update by push", rs.dst,
|
||||||
ref->new_sha1, NULL, 0, 0);
|
ref->new_sha1, NULL, 0, 0);
|
||||||
|
@ -451,6 +451,18 @@ __git_find_subcommand ()
|
|||||||
done
|
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_whitespacelist="nowarn warn error error-all strip"
|
||||||
|
|
||||||
_git_am ()
|
_git_am ()
|
||||||
@ -497,6 +509,8 @@ _git_apply ()
|
|||||||
|
|
||||||
_git_add ()
|
_git_add ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
@ -511,6 +525,8 @@ _git_add ()
|
|||||||
|
|
||||||
_git_bisect ()
|
_git_bisect ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local subcommands="start bad good skip reset visualize replay log run"
|
local subcommands="start bad good skip reset visualize replay log run"
|
||||||
local subcommand="$(__git_find_subcommand "$subcommands")"
|
local subcommand="$(__git_find_subcommand "$subcommands")"
|
||||||
if [ -z "$subcommand" ]; then
|
if [ -z "$subcommand" ]; then
|
||||||
@ -613,6 +629,8 @@ _git_cherry_pick ()
|
|||||||
|
|
||||||
_git_commit ()
|
_git_commit ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
@ -632,6 +650,8 @@ _git_describe ()
|
|||||||
|
|
||||||
_git_diff ()
|
_git_diff ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
@ -734,6 +754,8 @@ _git_ls_tree ()
|
|||||||
|
|
||||||
_git_log ()
|
_git_log ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--pretty=*)
|
--pretty=*)
|
||||||
@ -1086,6 +1108,8 @@ _git_remote ()
|
|||||||
|
|
||||||
_git_reset ()
|
_git_reset ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
@ -1098,6 +1122,8 @@ _git_reset ()
|
|||||||
|
|
||||||
_git_shortlog ()
|
_git_shortlog ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--*)
|
--*)
|
||||||
@ -1144,6 +1170,8 @@ _git_stash ()
|
|||||||
|
|
||||||
_git_submodule ()
|
_git_submodule ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local subcommands="add status init update"
|
local subcommands="add status init update"
|
||||||
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
|
if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
@ -1350,6 +1378,8 @@ _git ()
|
|||||||
|
|
||||||
_gitk ()
|
_gitk ()
|
||||||
{
|
{
|
||||||
|
__git_has_doubledash && return
|
||||||
|
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
local g="$(git rev-parse --git-dir 2>/dev/null)"
|
local g="$(git rev-parse --git-dir 2>/dev/null)"
|
||||||
local merge=""
|
local merge=""
|
||||||
|
@ -167,8 +167,7 @@ cmd_add()
|
|||||||
# perhaps the path exists and is already a git repo, else clone it
|
# perhaps the path exists and is already a git repo, else clone it
|
||||||
if test -e "$path"
|
if test -e "$path"
|
||||||
then
|
then
|
||||||
if test -d "$path/.git" &&
|
if test -d "$path"/.git -o -f "$path"/.git
|
||||||
test "$(unset GIT_DIR; cd $path; git rev-parse --git-dir)" = ".git"
|
|
||||||
then
|
then
|
||||||
echo "Adding existing repo at '$path' to the index"
|
echo "Adding existing repo at '$path' to the index"
|
||||||
else
|
else
|
||||||
|
2
refs.c
2
refs.c
@ -925,7 +925,7 @@ int delete_ref(const char *refname, const unsigned char *sha1)
|
|||||||
i = strlen(lock->lk->filename) - 5; /* .lock */
|
i = strlen(lock->lk->filename) - 5; /* .lock */
|
||||||
lock->lk->filename[i] = 0;
|
lock->lk->filename[i] = 0;
|
||||||
err = unlink(lock->lk->filename);
|
err = unlink(lock->lk->filename);
|
||||||
if (err) {
|
if (err && errno != ENOENT) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
error("unlink(%s) failed: %s",
|
error("unlink(%s) failed: %s",
|
||||||
lock->lk->filename, strerror(errno));
|
lock->lk->filename, strerror(errno));
|
||||||
|
@ -10,6 +10,7 @@ test_expect_success 'setup' '
|
|||||||
git commit -m 1 &&
|
git commit -m 1 &&
|
||||||
git branch b1 &&
|
git branch b1 &&
|
||||||
git branch b2 &&
|
git branch b2 &&
|
||||||
|
git branch b3 &&
|
||||||
git clone . aa &&
|
git clone . aa &&
|
||||||
git checkout b1 &&
|
git checkout b1 &&
|
||||||
echo b1 >>file &&
|
echo b1 >>file &&
|
||||||
@ -50,4 +51,10 @@ test_expect_success 'deleted branches have their tracking branches removed' '
|
|||||||
test "$(git rev-parse origin/b1)" = "origin/b1"
|
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
|
test_done
|
||||||
|
@ -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_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' '
|
test_expect_success 'clone checks out files' '
|
||||||
|
|
||||||
|
rm -fr dst &&
|
||||||
git clone src dst &&
|
git clone src dst &&
|
||||||
test -f dst/file
|
test -f dst/file
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user