* [PATCH 0/3] bisect: add support for bisecting bare repositories
From: Jon Seymour @ 2011-08-07 10:50 UTC (permalink / raw)
To: git; +Cc: gitster, chriscool, j6t, jnareb, jrnieder, Jon Seymour
This extension to js/bisect-no-checkout (currently in pu) adds support for bisecting bare repositories.
It does this by relaxing the requirement that git bisect is invoked in a repository with a working tree and by
defaulting to --no-checkout in the case of a bare repository.
Two tests are included to demonstrate this behaviour.
Jon Seymour (3):
bisect: relax requirement for a working tree.
bisect: add tests for bisection on bare repositories
bisect: document that --no-checkout is the default for bare
repositories
Documentation/git-bisect.txt | 2 ++
git-bisect.sh | 8 ++++++--
git.c | 2 +-
t/t6030-bisect-porcelain.sh | 28 ++++++++++++++++++++++++++++
4 files changed, 37 insertions(+), 3 deletions(-)
--
1.7.6.363.g9b380.dirty
^ permalink raw reply
* [PATCH 1/3] bisect: relax requirement for a working tree.
From: Jon Seymour @ 2011-08-07 10:50 UTC (permalink / raw)
To: git; +Cc: gitster, chriscool, j6t, jnareb, jrnieder, Jon Seymour
In-Reply-To: <1312714240-23647-1-git-send-email-jon.seymour@gmail.com>
Now that bisection does not require checkout, it can work
on bare repositories too.
In this case, we default the checkout mode to --no-checkout,
thereby forcing the creation of BISECT_HEAD on either a manual
or automatic start.
The require_work_tree check in git-bisect.sh and the NEED_WORK_TREE
check in git.c are relaxed.
Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-bisect.sh | 8 ++++++--
git.c | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/git-bisect.sh b/git-bisect.sh
index 22c4da5..436cc07 100755
--- a/git-bisect.sh
+++ b/git-bisect.sh
@@ -29,7 +29,6 @@ Please use "git help bisect" to get the full man page.'
OPTIONS_SPEC=
. git-sh-setup
. git-sh-i18n
-require_work_tree
_x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
_x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
@@ -79,7 +78,12 @@ bisect_start() {
orig_args=$(git rev-parse --sq-quote "$@")
bad_seen=0
eval=''
- mode=''
+ if test "z$(git rev-parse --is-bare-repository)" != "zfalse"
+ then
+ mode='--no-checkout'
+ else
+ mode=''
+ fi
while [ $# -gt 0 ]; do
arg="$1"
case "$arg" in
diff --git a/git.c b/git.c
index 8828c18..7fdcab2 100644
--- a/git.c
+++ b/git.c
@@ -320,7 +320,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "annotate", cmd_annotate, RUN_SETUP },
{ "apply", cmd_apply, RUN_SETUP_GENTLY },
{ "archive", cmd_archive },
- { "bisect--helper", cmd_bisect__helper, RUN_SETUP | NEED_WORK_TREE },
+ { "bisect--helper", cmd_bisect__helper, RUN_SETUP },
{ "blame", cmd_blame, RUN_SETUP },
{ "branch", cmd_branch, RUN_SETUP },
{ "bundle", cmd_bundle, RUN_SETUP_GENTLY },
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH 2/3] bisect: add tests for bisection on bare repositories
From: Jon Seymour @ 2011-08-07 10:50 UTC (permalink / raw)
To: git; +Cc: gitster, chriscool, j6t, jnareb, jrnieder, Jon Seymour
In-Reply-To: <1312714240-23647-1-git-send-email-jon.seymour@gmail.com>
We add a test to check that bisection works on bare repositories
both when --no-checkout is specified explicitly and when it
is defaulted.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
t/t6030-bisect-porcelain.sh | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 4fb7d11..eb0412c 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -592,6 +592,34 @@ test_expect_success 'erroring out when using bad path parameters' '
grep "bad path parameters" error.txt
'
+test_expect_success 'create bare repo' '
+ git clone --bare . bare
+'
+
+test_expect_success 'test bisection on bare repo - --no-checkout specified' '
+ test_when_finished "cd .." &&
+ cd bare &&
+ git bisect start --no-checkout &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run sh -c \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../my_bisect_log.txt &&
+ grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
+ git bisect reset'
+
+test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
+ test_when_finished "cd .." &&
+ cd bare &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run sh -c \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../my_bisect_log.txt &&
+ grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
+ git bisect reset'
+
#
# This creates a broken branch which cannot be checked out because
# the tree created has been deleted.
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH 3/3] bisect: document that --no-checkout is the default for bare repositories
From: Jon Seymour @ 2011-08-07 10:50 UTC (permalink / raw)
To: git; +Cc: gitster, chriscool, j6t, jnareb, jrnieder, Jon Seymour
In-Reply-To: <1312714240-23647-1-git-send-email-jon.seymour@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
Documentation/git-bisect.txt | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
index 41e6ca8..e4f46bc 100644
--- a/Documentation/git-bisect.txt
+++ b/Documentation/git-bisect.txt
@@ -273,6 +273,8 @@ it point to the commit that should be tested.
+
This option may be useful when the test you would perform in each step
does not require a checked out tree.
++
+If the repository is bare, `--no-checkout` is assumed.
EXAMPLES
--------
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH v2 0/5] gettext: add gettextln, eval_gettextln to encode common idiom
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
Currently, if you want to use gettext or eval_gettext to format a message
you may have to add a separate echo statement and a surrounding subshell
in order to interpolate the required trailing new line.
This patch introduces two new helper functions, gettextln and eval_gettextln
which append a trailing newline to the gettext output.
This allows constructions of the form:
if test -s "$GIT_DIR/BISECT_START"
then
(
gettext "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
echo
) >&2
else
...
to be expressed more concisely as:
if test -s "$GIT_DIR/BISECT_START"
then
gettextln "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
else
...
Applies cleanly to master and pu.
Revisions
=========
v2:
Split modifications to git-sh-i18n.sh into separate commit.
Extended application to:
git-am.sh
git-pull.sh
git-stash.sh
git-submodule.sh
Removed application to git-bisect.sh, pending stabilisation of this series and js/bisect-no-checkout in next or master.
v1: Initial RFC. Included example of application to git-bisect.sh.
Future
======
Apply to git-bisect.sh
Jon Seymour (5):
gettext: add gettextln, eval_gettextln to encode common idiom
git-am: take advantage of gettextln and eval_gettextln.
pull: take advantage of eval_gettextln
stash: take advantage of eval_gettextln
submodule: take advantage of gettextln and eval_gettextln.
git-am.sh | 31 ++++++++++++++-----------------
git-pull.sh | 7 ++-----
git-sh-i18n.sh | 19 +++++++++++++++++++
git-stash.sh | 9 +++------
git-submodule.sh | 18 ++++++------------
5 files changed, 44 insertions(+), 40 deletions(-)
--
1.7.6.363.g9b380.dirty
^ permalink raw reply
* [PATCH v2 2/5] git-am: take advantage of gettextln and eval_gettextln.
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
In-Reply-To: <1312718297-10999-1-git-send-email-jon.seymour@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-am.sh | 31 ++++++++++++++-----------------
1 files changed, 14 insertions(+), 17 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 463c741..6177567 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -89,11 +89,8 @@ safe_to_abort () {
then
return 0
fi
- (
- gettext "You seem to have moved HEAD since the last 'am' failure.
-Not rewinding to ORIG_HEAD" &&
- echo
- ) >&2
+ gettextln "You seem to have moved HEAD since the last 'am' failure.
+Not rewinding to ORIG_HEAD" >&2
return 1
}
@@ -102,9 +99,9 @@ stop_here_user_resolve () {
printf '%s\n' "$resolvemsg"
stop_here $1
fi
- eval_gettext "When you have resolved this problem run \"\$cmdline --resolved\".
+ eval_gettextln "When you have resolved this problem run \"\$cmdline --resolved\".
If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
-To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
+To restore the original branch and stop patching run \"\$cmdline --abort\"."
stop_here $1
}
@@ -118,7 +115,7 @@ go_next () {
cannot_fallback () {
echo "$1"
- gettext "Cannot fall back to three-way merge."; echo
+ gettextln "Cannot fall back to three-way merge."
exit 1
}
@@ -611,9 +608,9 @@ do
go_next && continue
test -s "$dotest/patch" || {
- eval_gettext "Patch is empty. Was it split wrong?
+ eval_gettextln "Patch is empty. Was it split wrong?
If you would prefer to skip this patch, instead run \"\$cmdline --skip\".
-To restore the original branch and stop patching run \"\$cmdline --abort\"."; echo
+To restore the original branch and stop patching run \"\$cmdline --abort\"."
stop_here $this
}
rm -f "$dotest/original-commit" "$dotest/author-script"
@@ -648,7 +645,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ec
if test -z "$GIT_AUTHOR_EMAIL"
then
- gettext "Patch does not have a valid e-mail address."; echo
+ gettextln "Patch does not have a valid e-mail address."
stop_here $this
fi
@@ -699,7 +696,7 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ec
action=again
while test "$action" = again
do
- gettext "Commit Body is:"; echo
+ gettextln "Commit Body is:"
echo "--------------------------"
cat "$dotest/final-commit"
echo "--------------------------"
@@ -763,16 +760,16 @@ To restore the original branch and stop patching run \"\$cmdline --abort\"."; ec
# working tree.
resolved=
git diff-index --quiet --cached HEAD -- && {
- gettext "No changes - did you forget to use 'git add'?
+ gettextln "No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
-already introduced the same changes; you might want to skip this patch."; echo
+already introduced the same changes; you might want to skip this patch."
stop_here_user_resolve $this
}
unmerged=$(git ls-files -u)
if test -n "$unmerged"
then
- gettext "You still have unmerged paths in your index
-did you forget to use 'git add'?"; echo
+ gettextln "You still have unmerged paths in your index
+did you forget to use 'git add'?"
stop_here_user_resolve $this
fi
apply_status=0
@@ -797,7 +794,7 @@ did you forget to use 'git add'?"; echo
fi
if test $apply_status != 0
then
- eval_gettext 'Patch failed at $msgnum $FIRSTLINE'; echo
+ eval_gettextln 'Patch failed at $msgnum $FIRSTLINE'
stop_here_user_resolve $this
fi
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH v2 1/5] gettext: add gettextln, eval_gettextln to encode common idiom
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
In-Reply-To: <1312718297-10999-1-git-send-email-jon.seymour@gmail.com>
Currently, if you want to use gettext or eval_gettext to format a message
you may have to add a separate echo statement and a surrounding subshell
in order to interpolate the required trailing new line.
This patch introduces two new helper functions, gettextln and eval_gettextln
which append a trailing newline to the gettext output.
This allows constructions of the form:
if test -s "$GIT_DIR/BISECT_START"
then
(
gettext "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" &&
echo
) >&2
else
...
to be expressed more concisely as:
if test -s "$GIT_DIR/BISECT_START"
then
gettextln "You need to give me at least one good and one bad revisions.
(You can use \"git bisect bad\" and \"git bisect good\" for that.)" >&2
else
...
Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-sh-i18n.sh | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/git-sh-i18n.sh b/git-sh-i18n.sh
index 32ca59d..e672366 100644
--- a/git-sh-i18n.sh
+++ b/git-sh-i18n.sh
@@ -11,19 +11,38 @@ then
printf "%s" "$1"
}
+ gettextln() {
+ printf "%s\n" "$1"
+ }
+
eval_gettext () {
printf "%s" "$1" | (
export PATH $(git sh-i18n--envsubst --variables "$1");
git sh-i18n--envsubst "$1"
)
}
+
+ eval_gettextln () {
+ printf "%s\n" "$1" | (
+ export PATH $(git sh-i18n--envsubst --variables "$1");
+ git sh-i18n--envsubst "$1"
+ )
+ }
else
gettext () {
printf "%s" "# GETTEXT POISON #"
}
+ gettextln () {
+ printf "%s\n" "# GETTEXT POISON #"
+ }
+
eval_gettext () {
printf "%s" "# GETTEXT POISON #"
}
+
+ eval_gettextln () {
+ printf "%s\n" "# GETTEXT POISON #"
+ }
fi
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH v2 3/5] pull: take advantage of eval_gettextln
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
In-Reply-To: <1312718297-10999-1-git-send-email-jon.seymour@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-pull.sh | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index a10b129..d3ffd8f 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -217,12 +217,9 @@ then
# $orig_head commit, but we are merging into $curr_head.
# First update the working tree to match $curr_head.
- (
- eval_gettext "Warning: fetch updated the current branch head.
+ eval_gettextln "Warning: fetch updated the current branch head.
Warning: fast-forwarding your working tree from
-Warning: commit \$orig_head." &&
- echo
- ) >&2
+Warning: commit \$orig_head." >&2
git update-index -q --refresh
git read-tree -u -m "$orig_head" "$curr_head" ||
die "$(eval_gettext "Cannot fast-forward your working tree.
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH v2 4/5] stash: take advantage of eval_gettextln
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
In-Reply-To: <1312718297-10999-1-git-send-email-jon.seymour@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-stash.sh | 9 +++------
1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/git-stash.sh b/git-stash.sh
index f4e6f05..31dec0a 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -198,8 +198,8 @@ save_stash () {
# $ git stash save --blah-blah 2>&1 | head -n 2
# error: unknown option for 'stash save': --blah-blah
# To provide a message, use git stash save -- '--blah-blah'
- eval_gettext "$("error: unknown option for 'stash save': \$option
- To provide a message, use git stash save -- '\$option'")"; echo
+ eval_gettextln "$("error: unknown option for 'stash save': \$option
+ To provide a message, use git stash save -- '\$option'")"
usage
;;
*)
@@ -470,10 +470,7 @@ apply_stash () {
status=$?
if test -n "$INDEX_OPTION"
then
- (
- gettext "Index was not unstashed." &&
- echo
- ) >&2
+ gettextln "Index was not unstashed." >&2
fi
exit $status
fi
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* [PATCH v2 5/5] submodule: take advantage of gettextln and eval_gettextln.
From: Jon Seymour @ 2011-08-07 11:58 UTC (permalink / raw)
To: git; +Cc: avarab, Jens.Lehmann, gitster, Jon Seymour
In-Reply-To: <1312718297-10999-1-git-send-email-jon.seymour@gmail.com>
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---
git-submodule.sh | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index bc1d3fa..986c5d6 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -223,12 +223,9 @@ cmd_add()
if test -z "$force" && ! git add --dry-run --ignore-missing "$path" > /dev/null 2>&1
then
- (
- eval_gettext "The following path is ignored by one of your .gitignore files:
+ eval_gettextln "The following path is ignored by one of your .gitignore files:
\$path
-Use -f if you really want to add it." &&
- echo
- ) >&2
+Use -f if you really want to add it." >&2
exit 1
fi
@@ -237,7 +234,7 @@ Use -f if you really want to add it." &&
then
if test -d "$path"/.git -o -f "$path"/.git
then
- eval_gettext "Adding existing repo at '\$path' to the index"; echo
+ eval_gettextln "Adding existing repo at '\$path' to the index"
else
die "$(eval_gettext "'\$path' already exists and is not a valid git repo")"
fi
@@ -696,10 +693,7 @@ cmd_summary() {
;; # removed
*)
# unexpected type
- (
- eval_gettext "unexpected mode \$mod_dst" &&
- echo
- ) >&2
+ eval_gettextln "unexpected mode \$mod_dst" >&2
continue ;;
esac
fi
@@ -786,9 +780,9 @@ cmd_summary() {
done |
if test -n "$for_status"; then
if [ -n "$files" ]; then
- gettext "# Submodules changed but not updated:"; echo
+ gettextln "# Submodules changed but not updated:"
else
- gettext "# Submodule changes to be committed:"; echo
+ gettextln "# Submodule changes to be committed:"
fi
echo "#"
sed -e 's|^|# |' -e 's|^# $|#|'
--
1.7.6.363.g9b380.dirty
^ permalink raw reply related
* test z$foo = zbar (and Re: [PATCH 1/3] bisect: relax requirement for a working tree.)
From: Jonathan Nieder @ 2011-08-07 12:41 UTC (permalink / raw)
To: Jon Seymour; +Cc: git, gitster, chriscool, j6t, jnareb
In-Reply-To: <1312714240-23647-2-git-send-email-jon.seymour@gmail.com>
Jon Seymour wrote:
> Now that bisection does not require checkout, it can work
> on bare repositories too.
Nice.
> --- a/git-bisect.sh
> +++ b/git-bisect.sh
> @@ -29,7 +29,6 @@ Please use "git help bisect" to get the full man page.'
> OPTIONS_SPEC=
> . git-sh-setup
> . git-sh-i18n
> -require_work_tree
>
> _x40='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
> _x40="$_x40$_x40$_x40$_x40$_x40$_x40$_x40$_x40"
> @@ -79,7 +78,12 @@ bisect_start() {
> orig_args=$(git rev-parse --sq-quote "$@")
> bad_seen=0
> eval=''
> - mode=''
> + if test "z$(git rev-parse --is-bare-repository)" != "zfalse"
> + then
> + mode='--no-checkout'
> + else
> + mode=''
> + fi
Am I the only one who finds this
test "z$foo" = "zbar"
style to be impossibly ugly? It means every time someone considers
using the "test" utility, they decide "is this expression likely to
looks like an operator" and each time someone reads a use of the
"test" utility, there is a lingering question of whether that choice
was made correctly. By contrast, if one follows the following simple
rules, everything works fine with the shells git supports:
- _Do_ use the "z$foo" trick when using expr.
- Do not use test's '(', '),' -a and -o operators; use && and ||
instead.
The Autoconf manual says
Posix also says that ‘test ! "string"’, ‘test -n "string"’ and
‘test -z "string"’ work with any string, but many shells (such
as Solaris, AIX 3.2, UNICOS 10.0.0.6, Digital Unix 4, etc.)
get confused if string looks like an operator:
Notice that none of the mentioned shells is close enough to POSIX even
to support $( / ). This is an area in which early POSIX work improved
shells immensely (the "-e" primary was introduced around the same
time).
^ permalink raw reply
* Re: test z$foo = zbar (and Re: [PATCH 1/3] bisect: relax requirement for a working tree.)
From: Jon Seymour @ 2011-08-07 12:51 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, gitster, chriscool, j6t, jnareb
In-Reply-To: <20110807124150.GA20046@elie.gateway.2wire.net>
On Sun, Aug 7, 2011 at 10:41 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jon Seymour wrote:
+ fi
>
> Am I the only one who finds this
>
> test "z$foo" = "zbar"
>
Yeah, I do too.
The only reason I did it this way was because this is how it is done
in git-sh-setup.
jon.
^ permalink raw reply
* Re: test z$foo = zbar (and Re: [PATCH 1/3] bisect: relax requirement for a working tree.)
From: Stefano Lattarini @ 2011-08-07 13:04 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: Jon Seymour, git, gitster, chriscool, j6t, jnareb
In-Reply-To: <20110807124150.GA20046@elie.gateway.2wire.net>
On Sunday 07 August 2011, Jonathan Nieder wrote:
> Am I the only one who finds this
>
> test "z$foo" = "zbar"
>
> style to be impossibly ugly? It means every time someone considers
> using the "test" utility, they decide "is this expression likely to
> looks like an operator" and each time someone reads a use of the
> "test" utility, there is a lingering question of whether that choice
> was made correctly. By contrast, if one follows the following simple
> rules, everything works fine with the shells git supports:
>
> - _Do_ use the "z$foo" trick when using expr.
> - Do not use test's '(', '),' -a and -o operators; use && and ||
> instead.
>
> The Autoconf manual says
>
> Posix also says that ‘test ! "string"’, ‘test -n "string"’ and
> ‘test -z "string"’ work with any string, but many shells (such
> as Solaris, AIX 3.2, UNICOS 10.0.0.6, Digital Unix 4, etc.)
> get confused if string looks like an operator:
>
> Notice that none of the mentioned shells is close enough to POSIX even
> to support $( / ). This is an area in which early POSIX work improved
> shells immensely (the "-e" primary was introduced around the same
> time).
>
While this is true, some problems with the `test' builtin persists also
with in more "posixy" shells. For example, with Solaris /bin/ksh and
/usr/xpg4/bin/sh (the latter expected to be the default POSIX-compliant
shell on the system, since as you've noticed /bin/sh is defintely not
compliant there), one sees:
$ /usr/xpg4/bin/sh -c 'test -z ")"'; echo $?
0
$ /bin/ksh -c 'test -z ")"'; echo $?
0
This will be documented in the next version of the Autoconf manual BTW.
Regards,
Stefano
^ permalink raw reply
* [PATCH 0/4] git-p4 test cleanup, commit time change
From: Pete Wyckoff @ 2011-08-07 13:31 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Luke Diamand
Here's a small patch series to clean up the git-p4 tests a bit,
make them work on a 2-user eval p4d, and to fix a problem with
the timestamp on the import commit.
[PATCH 1/4] git-p4: use test_when_finished in tests
[PATCH 2/4] git-p4: add missing && in test
[PATCH 3/4] git-p4: one test missing config
[PATCH 4/4] git-p4: commit time should be most recent p4 change time
contrib/fast-import/git-p4 | 15 +++++
t/t9800-git-p4.sh | 125 +++++++++++++++++++++++++--------------------
2 files changed, 84 insertions(+), 56 deletions(-)
Luke acked them, and I've been using it for a couple of weeks. Could you
include them in the next convenient release? Thanks,
-- Pete
^ permalink raw reply
* [PATCH 1/4] git-p4: use test_when_finished in tests
From: Pete Wyckoff @ 2011-08-07 13:32 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Luke Diamand
In-Reply-To: <20110807133144.GA27521@arf.padd.com>
Cleanup nicely when tests fail. This avoids many duplicated
lines in the tests, and adds cleanup in a couple of tests that
did not have it. When one fails, now all the rest will not
fail too.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
---
t/t9800-git-p4.sh | 103 +++++++++++++++++++++++++----------------------------
1 files changed, 49 insertions(+), 54 deletions(-)
diff --git a/t/t9800-git-p4.sh b/t/t9800-git-p4.sh
index 33b0127..aec3ba1 100755
--- a/t/t9800-git-p4.sh
+++ b/t/t9800-git-p4.sh
@@ -45,29 +45,33 @@ test_expect_success 'add p4 files' '
cd "$TRASH_DIRECTORY"
'
+cleanup_git() {
+ cd "$TRASH_DIRECTORY" &&
+ rm -rf "$git" &&
+ mkdir "$git"
+}
+
test_expect_success 'basic git-p4 clone' '
"$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
git log --oneline >lines &&
- test_line_count = 1 lines &&
- cd .. &&
- rm -rf "$git" && mkdir "$git"
+ test_line_count = 1 lines
'
test_expect_success 'git-p4 clone @all' '
"$GITP4" clone --dest="$git" //depot@all &&
+ test_when_finished cleanup_git &&
cd "$git" &&
git log --oneline >lines &&
- test_line_count = 2 lines &&
- cd .. &&
- rm -rf "$git" && mkdir "$git"
+ test_line_count = 2 lines
'
test_expect_success 'git-p4 sync uninitialized repo' '
test_create_repo "$git" &&
+ test_when_finished cleanup_git &&
cd "$git" &&
- test_must_fail "$GITP4" sync &&
- rm -rf "$git" && mkdir "$git"
+ test_must_fail "$GITP4" sync
'
#
@@ -76,19 +80,18 @@ test_expect_success 'git-p4 sync uninitialized repo' '
#
test_expect_success 'git-p4 sync new branch' '
test_create_repo "$git" &&
+ test_when_finished cleanup_git &&
cd "$git" &&
test_commit head &&
"$GITP4" sync --branch=refs/remotes/p4/depot //depot@all &&
git log --oneline p4/depot >lines &&
- cat lines &&
- test_line_count = 2 lines &&
- cd .. &&
- rm -rf "$git" && mkdir "$git"
+ test_line_count = 2 lines
'
test_expect_success 'exit when p4 fails to produce marshaled output' '
badp4dir="$TRASH_DIRECTORY/badp4dir" &&
mkdir -p "$badp4dir" &&
+ test_when_finished "rm -rf $badp4dir" &&
cat >"$badp4dir"/p4 <<-EOF &&
#!$SHELL_PATH
exit 1
@@ -106,29 +109,26 @@ test_expect_success 'add p4 files with wildcards in the names' '
echo file-wild-at >file-wild@at &&
echo file-wild-percent >file-wild%percent &&
p4 add -f file-wild* &&
- p4 submit -d "file wildcards" &&
- cd "$TRASH_DIRECTORY"
+ p4 submit -d "file wildcards"
'
test_expect_success 'wildcard files git-p4 clone' '
"$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
test -f file-wild#hash &&
test -f file-wild\*star &&
test -f file-wild@at &&
- test -f file-wild%percent &&
- cd "$TRASH_DIRECTORY" &&
- rm -rf "$git" && mkdir "$git"
+ test -f file-wild%percent
'
test_expect_success 'clone bare' '
"$GITP4" clone --dest="$git" --bare //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
test ! -d .git &&
bare=`git config --get core.bare` &&
- test "$bare" = true &&
- cd "$TRASH_DIRECTORY" &&
- rm -rf "$git" && mkdir "$git"
+ test "$bare" = true
'
p4_add_user() {
@@ -173,6 +173,7 @@ test_expect_success 'preserve users' '
p4_add_user bob Bob &&
p4_grant_admin alice &&
"$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
echo "username: a change by alice" >> file1 &&
echo "username: a change by bob" >> file2 &&
@@ -181,27 +182,25 @@ test_expect_success 'preserve users' '
git config git-p4.skipSubmitEditCheck true &&
P4EDITOR=touch P4USER=alice P4PASSWD=secret "$GITP4" commit --preserve-user &&
p4_check_commit_author file1 alice &&
- p4_check_commit_author file2 bob &&
- cd "$TRASH_DIRECTORY" &&
- rm -rf "$git" && mkdir "$git"
+ p4_check_commit_author file2 bob
'
# Test username support, submitting as bob, who lacks admin rights. Should
# not submit change to p4 (git diff should show deltas).
test_expect_success 'refuse to preserve users without perms' '
"$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
echo "username-noperms: a change by alice" >> file1 &&
git commit --author "Alice <alice@localhost>" -m "perms: a change by alice" file1 &&
! P4EDITOR=touch P4USER=bob P4PASSWD=secret "$GITP4" commit --preserve-user &&
- ! git diff --exit-code HEAD..p4/master > /dev/null &&
- cd "$TRASH_DIRECTORY" &&
- rm -rf "$git" && mkdir "$git"
+ ! git diff --exit-code HEAD..p4/master > /dev/null
'
# What happens with unknown author? Without allowMissingP4Users it should fail.
test_expect_success 'preserve user where author is unknown to p4' '
"$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
cd "$git" &&
git config git-p4.skipSubmitEditCheck true
echo "username-bob: a change by bob" >> file1 &&
@@ -215,9 +214,7 @@ test_expect_success 'preserve user where author is unknown to p4' '
git config git-p4.preserveUser true &&
P4EDITOR=touch P4USER=alice P4PASSWD=secret "$GITP4" commit &&
git diff --exit-code HEAD..p4/master > /dev/null &&
- p4_check_commit_author file1 alice &&
- cd "$TRASH_DIRECTORY" &&
- rm -rf "$git" && mkdir "$git"
+ p4_check_commit_author file1 alice
'
# If we're *not* using --preserve-user, git-p4 should warn if we're submitting
@@ -226,31 +223,29 @@ test_expect_success 'preserve user where author is unknown to p4' '
# Test: warning disabled and user is the same.
test_expect_success 'not preserving user with mixed authorship' '
"$GITP4" clone --dest="$git" //depot &&
- (
- cd "$git" &&
- git config git-p4.skipSubmitEditCheck true &&
- p4_add_user derek Derek &&
-
- make_change_by_user usernamefile3 Derek derek@localhost &&
- P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
- grep "git author derek@localhost does not match" actual &&
-
- make_change_by_user usernamefile3 Charlie charlie@localhost &&
- P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
- grep "git author charlie@localhost does not match" actual &&
-
- make_change_by_user usernamefile3 alice alice@localhost &&
- P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
- ! grep "git author.*does not match" actual &&
-
- git config git-p4.skipUserNameCheck true &&
- make_change_by_user usernamefile3 Charlie charlie@localhost &&
- P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
- ! grep "git author.*does not match" actual &&
-
- p4_check_commit_author usernamefile3 alice
- ) &&
- rm -rf "$git" && mkdir "$git"
+ test_when_finished cleanup_git &&
+ cd "$git" &&
+ git config git-p4.skipSubmitEditCheck true &&
+ p4_add_user derek Derek &&
+
+ make_change_by_user usernamefile3 Derek derek@localhost &&
+ P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
+ grep "git author derek@localhost does not match" actual &&
+
+ make_change_by_user usernamefile3 Charlie charlie@localhost &&
+ P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
+ grep "git author charlie@localhost does not match" actual &&
+
+ make_change_by_user usernamefile3 alice alice@localhost &&
+ P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
+ ! grep "git author.*does not match" actual &&
+
+ git config git-p4.skipUserNameCheck true &&
+ make_change_by_user usernamefile3 Charlie charlie@localhost &&
+ P4EDITOR=cat P4USER=alice P4PASSWD=secret "$GITP4" commit >actual &&
+ ! grep "git author.*does not match" actual &&
+
+ p4_check_commit_author usernamefile3 alice
'
--
1.7.5.4
^ permalink raw reply related
* [PATCH 2/4] git-p4: add missing && in test
From: Pete Wyckoff @ 2011-08-07 13:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Luke Diamand
In-Reply-To: <20110807133144.GA27521@arf.padd.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
---
t/t9800-git-p4.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t9800-git-p4.sh b/t/t9800-git-p4.sh
index aec3ba1..b7eda82 100755
--- a/t/t9800-git-p4.sh
+++ b/t/t9800-git-p4.sh
@@ -202,7 +202,7 @@ test_expect_success 'preserve user where author is unknown to p4' '
"$GITP4" clone --dest="$git" //depot &&
test_when_finished cleanup_git &&
cd "$git" &&
- git config git-p4.skipSubmitEditCheck true
+ git config git-p4.skipSubmitEditCheck true &&
echo "username-bob: a change by bob" >> file1 &&
git commit --author "Bob <bob@localhost>" -m "preserve: a change by bob" file1 &&
echo "username-unknown: a change by charlie" >> file1 &&
--
1.7.5.4
^ permalink raw reply related
* [PATCH 3/4] git-p4: one test missing config git-p4.skipSubmitEditCheck
From: Pete Wyckoff @ 2011-08-07 13:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Luke Diamand
In-Reply-To: <20110807133144.GA27521@arf.padd.com>
Add this missing line in one of the tests. Otherwise, on fast
machines, the following git-p4 commit will complain that nobody
edited the submission message.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
---
t/t9800-git-p4.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/t9800-git-p4.sh b/t/t9800-git-p4.sh
index b7eda82..b304707 100755
--- a/t/t9800-git-p4.sh
+++ b/t/t9800-git-p4.sh
@@ -191,6 +191,7 @@ test_expect_success 'refuse to preserve users without perms' '
"$GITP4" clone --dest="$git" //depot &&
test_when_finished cleanup_git &&
cd "$git" &&
+ git config git-p4.skipSubmitEditCheck true &&
echo "username-noperms: a change by alice" >> file1 &&
git commit --author "Alice <alice@localhost>" -m "perms: a change by alice" file1 &&
! P4EDITOR=touch P4USER=bob P4PASSWD=secret "$GITP4" commit --preserve-user &&
--
1.7.5.4
^ permalink raw reply related
* [PATCH 4/4] git-p4: commit time should be most recent p4 change time
From: Pete Wyckoff @ 2011-08-07 13:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Luke Diamand
In-Reply-To: <20110807133144.GA27521@arf.padd.com>
When importing a repo, the time on the initial commit had been
just "now". But this causes problems when trying to share among
git-p4 repos that were created identically, although at different
times. Instead, use the time in the top-most p4 change as the
time for the git import commit.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-by: Luke Diamand <luke@diamand.org>
---
contrib/fast-import/git-p4 | 15 ++++++++++++++-
t/t9800-git-p4.sh | 19 +++++++++++++++++++
2 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 98d2aee..6b9de9e 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1649,7 +1649,8 @@ class P4Sync(Command, P4UserMap):
def importHeadRevision(self, revision):
print "Doing initial import of %s from revision %s into %s" % (' '.join(self.depotPaths), revision, self.branch)
- details = { "user" : "git perforce import user", "time" : int(time.time()) }
+ details = {}
+ details["user"] = "git perforce import user"
details["desc"] = ("Initial import of %s from the state at revision %s\n"
% (' '.join(self.depotPaths), revision))
details["change"] = revision
@@ -1689,6 +1690,18 @@ class P4Sync(Command, P4UserMap):
fileCnt = fileCnt + 1
details["change"] = newestRevision
+
+ # Use time from top-most change so that all git-p4 clones of
+ # the same p4 repo have the same commit SHA1s.
+ res = p4CmdList("describe -s %d" % newestRevision)
+ newestTime = None
+ for r in res:
+ if r.has_key('time'):
+ newestTime = int(r['time'])
+ if newestTime is None:
+ die("\"describe -s\" on newest change %d did not give a time")
+ details["time"] = newestTime
+
self.updateOptionDict(details)
try:
self.commit(details, self.extractFilesFromCommit(details), self.branch, self.depotPaths)
diff --git a/t/t9800-git-p4.sh b/t/t9800-git-p4.sh
index b304707..97ec975 100755
--- a/t/t9800-git-p4.sh
+++ b/t/t9800-git-p4.sh
@@ -249,6 +249,25 @@ test_expect_success 'not preserving user with mixed authorship' '
p4_check_commit_author usernamefile3 alice
'
+marshal_dump() {
+ what=$1
+ python -c 'import marshal, sys; d = marshal.load(sys.stdin); print d["'$what'"]'
+}
+
+# Sleep a bit so that the top-most p4 change did not happen "now". Then
+# import the repo and make sure that the initial import has the same time
+# as the top-most change.
+test_expect_success 'initial import time from top change time' '
+ p4change=$(p4 -G changes -m 1 //depot/... | marshal_dump change) &&
+ p4time=$(p4 -G changes -m 1 //depot/... | marshal_dump time) &&
+ sleep 3 &&
+ "$GITP4" clone --dest="$git" //depot &&
+ test_when_finished cleanup_git &&
+ cd "$git" &&
+ gittime=$(git show -s --raw --pretty=format:%at HEAD) &&
+ echo $p4time $gittime &&
+ test $p4time = $gittime
+'
test_expect_success 'shutdown' '
pid=`pgrep -f p4d` &&
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH 2/3] bisect: add tests for bisection on bare repositories
From: Jonathan Nieder @ 2011-08-07 13:39 UTC (permalink / raw)
To: Jon Seymour; +Cc: git, gitster, chriscool, j6t, jnareb
In-Reply-To: <1312714240-23647-3-git-send-email-jon.seymour@gmail.com>
Jon Seymour wrote:
> We add a test to check that bisection works on bare repositories
> both when --no-checkout is specified explicitly and when it
> is defaulted.
Yay!
> --- a/t/t6030-bisect-porcelain.sh
> +++ b/t/t6030-bisect-porcelain.sh
> @@ -592,6 +592,34 @@ test_expect_success 'erroring out when using bad path parameters' '
> grep "bad path parameters" error.txt
> '
>
> +test_expect_success 'create bare repo' '
> + git clone --bare . bare
> +'
I'd prefer to see separate clones for the two tests, so if one
catastrophically fails it does not affect the other.
> +
> +test_expect_success 'test bisection on bare repo - --no-checkout specified' '
> + test_when_finished "cd .." &&
> + cd bare &&
> + git bisect start --no-checkout &&
> + git bisect good $HASH1 &&
> + git bisect bad $HASH4 &&
> + git bisect run sh -c \
> + "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
> + >../my_bisect_log.txt &&
> + grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
> + git bisect reset'
I worry that "sh" might not actually be a POSIX shell on some systems.
Maybe a subshell could also simplify this. Like so:
git clone --bare . bare.nocheckout &&
(
cd bare &&
git bisect start --no-checkout &&
git bisect good $HASH1 &&
git bisect bad $HASH4 &&
git bisect run \
eval "test \$(... " \
>../log.nocheckout &&
git bisect reset
) &&
grep "$HASH3 is the first bad commit" log.nocheckout
> +test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
Perhaps these could share code by using a function defined at the top
of the file.
With or without the changes described above, I like it. Thanks.
^ permalink raw reply
* Re: [PATCH 3/3] bisect: document that --no-checkout is the default for bare repositories
From: Jonathan Nieder @ 2011-08-07 13:43 UTC (permalink / raw)
To: Jon Seymour; +Cc: git, gitster, chriscool, j6t, jnareb
In-Reply-To: <1312714240-23647-4-git-send-email-jon.seymour@gmail.com>
Jon Seymour wrote:
> Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
> ---
> Documentation/git-bisect.txt | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/git-bisect.txt b/Documentation/git-bisect.txt
> index 41e6ca8..e4f46bc 100644
> --- a/Documentation/git-bisect.txt
> +++ b/Documentation/git-bisect.txt
> @@ -273,6 +273,8 @@ it point to the commit that should be tested.
> +
> This option may be useful when the test you would perform in each step
> does not require a checked out tree.
> ++
> +If the repository is bare, `--no-checkout` is assumed.
Thanks. I think this should be squashed with patches 1 and 2, though I
don't mind it having been split out for review.
The whole series looks good, even given the tiny nitpicks in patch 2 I
mentioned. :)
^ permalink raw reply
* Re: test z$foo = zbar (and Re: [PATCH 1/3] bisect: relax requirement for a working tree.)
From: Jonathan Nieder @ 2011-08-07 14:10 UTC (permalink / raw)
To: Stefano Lattarini; +Cc: Jon Seymour, git, gitster, chriscool, j6t, jnareb
In-Reply-To: <201108071505.00762.stefano.lattarini@gmail.com>
Stefano Lattarini wrote:
> $ /usr/xpg4/bin/sh -c 'test -z ")"'; echo $?
> 0
Yikes, thanks for pointing it out. I wonder if we should introduce a
sane_test function, like this.
empty_string () {
case $* in
?*)
return 1 ;;
*)
return 0 ;;
esac
}
# This is like "test", but:
# - it only implements a minimal subset of the functionality
# - it works around shells that cannot cope with parentheses as
# parameters to some operators, like ksh before 2008:
#
# $ /usr/xpg4/bin/sh -c 'test -z ")"'; echo $?
# 0
sane_test () {
# implied -n
test "$#" = 0 && set -- -n ""
test "$#" = 1 && set -- -n "$1"
test "$#" = 2 && test "z$1" = z! && set -- -z "$2"
test "$#" -le 4 ||
case $# in
2)
case $1 in
-z)
empty_string "$2" ;;
-n)
! empty_string "$2" ;;
-*)
test "$@" ;;
*)
die "sane_test: unrecognized unary operator $1" ;;
esac
;;
3)
case $2 in
= | !=)
test "z$1" "$2" "z$3" ;;
-eq | -lt | -gt | -le | -ge)
test "$@" ;;
*)
die "sane_test: unrecognized binary operator $2" ;;
esac
;;
4)
test "z$1" = z! ||
die "sane_test: unrecognized 4-argument test (not a negation)"
shift
! sane_test "$@"
;;
*)
die 'sane_test: too many arguments'
;;
esac
}
^ permalink raw reply
* Re: [PATCH 2/3] bisect: add tests for bisection on bare repositories
From: Jon Seymour @ 2011-08-07 14:39 UTC (permalink / raw)
To: Jonathan Nieder; +Cc: git, gitster, chriscool, j6t, jnareb
In-Reply-To: <20110807133939.GA10748@elie.gateway.2wire.net>
On Sun, Aug 7, 2011 at 11:39 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
> Jon Seymour wrote:
>
>> We add a test to check that bisection works on bare repositories
>> both when --no-checkout is specified explicitly and when it
>> is defaulted.
>
> Yay!
>
>> --- a/t/t6030-bisect-porcelain.sh
>> +++ b/t/t6030-bisect-porcelain.sh
>> @@ -592,6 +592,34 @@ test_expect_success 'erroring out when using bad path parameters' '
>> grep "bad path parameters" error.txt
>> '
>>
>> +test_expect_success 'create bare repo' '
>> + git clone --bare . bare
>> +'
>
> I'd prefer to see separate clones for the two tests, so if one
> catastrophically fails it does not affect the other.
>
>> +
>> +test_expect_success 'test bisection on bare repo - --no-checkout specified' '
>> + test_when_finished "cd .." &&
>> + cd bare &&
>> + git bisect start --no-checkout &&
>> + git bisect good $HASH1 &&
>> + git bisect bad $HASH4 &&
>> + git bisect run sh -c \
>> + "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
>> + >../my_bisect_log.txt &&
>> + grep "$HASH3 is the first bad commit" ../my_bisect_log.txt &&
>> + git bisect reset'
>
> I worry that "sh" might not actually be a POSIX shell on some systems.
> Maybe a subshell could also simplify this. Like so:
Thanks. Am assuming Junio is ok with use of eval, given these reasons.
The subshell is a good idea. So...
+test_expect_success 'test bisection on bare repo - --no-checkout specified' '
+ git clone --bare . bare.nocheckout &&
+ (
+ cd bare.nocheckout &&
+ git bisect start --no-checkout &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run eval \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../nocheckout.log &&
+ git bisect reset
+ ) &&
+ grep "$HASH3 is the first bad commit" nocheckout.log
+'
+
+
+test_expect_success 'test bisection on bare repo - --no-checkout defaulted' '
+ git clone --bare . bare.defaulted &&
+ (
+ cd bare.defaulted &&
+ git bisect start &&
+ git bisect good $HASH1 &&
+ git bisect bad $HASH4 &&
+ git bisect run eval \
+ "test \$(git rev-list BISECT_HEAD ^$HASH2 --max-count=1 | wc -l) = 0" \
+ >../defaulted.log &&
+ git bisect reset
+ ) &&
+ grep "$HASH3 is the first bad commit" defaulted.log
+'
+
jon.
^ permalink raw reply
* Re: [PATCH 1/3] bisect: relax requirement for a working tree.
From: Jon Seymour @ 2011-08-07 14:40 UTC (permalink / raw)
To: git
In-Reply-To: <1312714240-23647-2-git-send-email-jon.seymour@gmail.com>
On Sun, Aug 7, 2011 at 8:50 PM, Jon Seymour <jon.seymour@gmail.com> wrote:
> + if test "z$(git rev-parse --is-bare-repository)" != "zfalse"
Next iteration will remove double quotes from around zfalse.
jon.
^ permalink raw reply
* [PATCH v2] Tolerate zlib deflation with window size < 32Kb
From: roberto.tyley @ 2011-08-07 18:46 UTC (permalink / raw)
To: git; +Cc: gitster, Roberto Tyley
In-Reply-To: <7vhb5x5cgo.fsf@alter.siamese.dyndns.org>
From: Roberto Tyley <roberto.tyley@guardian.co.uk>
Git currently reports loose objects as 'corrupt' if they've been
deflated using a window size less than 32Kb, because the
experimental_loose_object() function doesn't recognise the header
byte as a zlib header. This patch makes the function tolerant of
all valid window sizes (15-bit to 8-bit) - but doesn't sacrifice
it's accuracy in distingushing the standard loose-object format
from the experimental (now abandoned) format.
On memory constrained systems zlib may use a much smaller window
size - working on Agit, I found that Android uses a 4KB window;
giving a header byte of 0x48, not 0x78. Consequently all loose
objects generated appear 'corrupt', which is why Agit is a read-only
Git client at this time - I don't want my client to generate Git
repos that other clients treat as broken :(
This patch makes Git tolerant of different deflate settings - it
might appear that it changes experimental_loose_object() to the point
where it could incorrectly identify the experimental format as the
standard one, but the two criteria (bitmask & checksum) can only
give a false result for an experimental object where both of the
following are true:
1) object size is exactly 8 bytes when uncompressed (bitmask)
2) [single-byte in-pack git type&size header] * 256
+ [1st byte of the following zlib header] % 31 = 0 (checksum)
As it happens, for all possible combinations of valid object type
(1-4) and window bits (0-7), the only time when the checksum will be
divisible by 31 is for 0x1838 - ie object type *1*, a Commit - which,
due the fields all Commit objects must contain, could never be as
small as 8 bytes in size.
Given this, the combination of the two criteria (bitmask & checksum)
always correctly determines the buffer format, and is more tolerant
than the previous version.
The alternative to this patch is simply removing support for the
experimental format, which I am also totally cool with.
References:
Android uses a 4KB window for deflation:
http://android.git.kernel.org/?p=platform/libcore.git;a=blob;f=luni/src/main/native/java_util_zip_Deflater.cpp;h=c0b2feff196e63a7b85d97cf9ae5bb2583409c28;hb=refs/heads/gingerbread#l53
Code snippet searching for false positives with the zlib checksum:
https://gist.github.com/1118177
Signed-off-by: Roberto Tyley <roberto.tyley@guardian.co.uk>
---
This updated patch contains the corrected 0x8F bitmask, and also
provides tests to ensure that the experimental & standard format
headers are still correctly identified and parsed.
As Git doesn't generate the old experimental format anymore, the
tests include a set of loose objects in that format created using
Git v1.4.3, as well as two objects generated on the Android platform
using a reduced-size window buffer for deflation.
sha1_file.c | 32 ++++++++--
t/t1013-loose-object-format.sh | 66 ++++++++++++++++++++
.../14/9cedb5c46929d18e0f118e9fa31927487af3b6 | Bin 0 -> 117 bytes
.../16/56f9233d999f61ef23ef390b9c71d75399f435 | Bin 0 -> 17 bytes
.../1e/72a6b2c4a577ab0338860fa9fe87f761fc9bbd | Bin 0 -> 18 bytes
.../25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 | Bin 0 -> 19 bytes
.../2e/65efe2a145dda7ee51d1741299f848e5bf752e | Bin 0 -> 10 bytes
.../6b/aee0540ea990d9761a3eb9ab183003a71c3696 | Bin 0 -> 181 bytes
.../70/e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd | Bin 0 -> 26 bytes
.../76/e7fa9941f4d5f97f64fea65a2cba436bc79cbb | Bin 0 -> 155 bytes
.../78/75c6237d3fcdd0ac2f0decc7d3fa6a50b66c09 | Bin 0 -> 139 bytes
.../7a/37b887a73791d12d26c0d3e39568a8fb0fa6e8 | Bin 0 -> 54 bytes
.../85/df50785d62d3b05ab03d9cbf7e4a0b49449730 | Bin 0 -> 13 bytes
.../8d/4e360d6c70fbd72411991c02a09c442cf7a9fa | Bin 0 -> 156 bytes
.../95/b1625de3ba8b2214d1e0d0591138aea733f64f | Bin 0 -> 252 bytes
.../9a/e9e86b7bd6cb1472d9373702d8249973da0832 | Bin 0 -> 11 bytes
.../bd/15045f6ce8ff75747562173640456a394412c8 | Bin 0 -> 34 bytes
.../e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 | Bin 0 -> 9 bytes
.../f8/16d5255855ac160652ee5253b06cd8ee14165a | Bin 0 -> 116 bytes
19 files changed, 92 insertions(+), 6 deletions(-)
create mode 100755 t/t1013-loose-object-format.sh
create mode 100644 t/t1013/objects/14/9cedb5c46929d18e0f118e9fa31927487af3b6
create mode 100644 t/t1013/objects/16/56f9233d999f61ef23ef390b9c71d75399f435
create mode 100644 t/t1013/objects/1e/72a6b2c4a577ab0338860fa9fe87f761fc9bbd
create mode 100644 t/t1013/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99
create mode 100644 t/t1013/objects/2e/65efe2a145dda7ee51d1741299f848e5bf752e
create mode 100644 t/t1013/objects/6b/aee0540ea990d9761a3eb9ab183003a71c3696
create mode 100644 t/t1013/objects/70/e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd
create mode 100644 t/t1013/objects/76/e7fa9941f4d5f97f64fea65a2cba436bc79cbb
create mode 100644 t/t1013/objects/78/75c6237d3fcdd0ac2f0decc7d3fa6a50b66c09
create mode 100644 t/t1013/objects/7a/37b887a73791d12d26c0d3e39568a8fb0fa6e8
create mode 100644 t/t1013/objects/85/df50785d62d3b05ab03d9cbf7e4a0b49449730
create mode 100644 t/t1013/objects/8d/4e360d6c70fbd72411991c02a09c442cf7a9fa
create mode 100644 t/t1013/objects/95/b1625de3ba8b2214d1e0d0591138aea733f64f
create mode 100644 t/t1013/objects/9a/e9e86b7bd6cb1472d9373702d8249973da0832
create mode 100644 t/t1013/objects/bd/15045f6ce8ff75747562173640456a394412c8
create mode 100644 t/t1013/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
create mode 100644 t/t1013/objects/f8/16d5255855ac160652ee5253b06cd8ee14165a
diff --git a/sha1_file.c b/sha1_file.c
index d5616dc..44444ae 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1217,14 +1217,34 @@ static int experimental_loose_object(unsigned char *map)
unsigned int word;
/*
- * Is it a zlib-compressed buffer? If so, the first byte
- * must be 0x78 (15-bit window size, deflated), and the
- * first 16-bit word is evenly divisible by 31. If so,
- * we are looking at the official format, not the experimental
- * one.
+ * We must determine if the buffer contains the standard
+ * zlib-deflated stream or the experimental format based
+ * on the in-pack object format. Compare the header byte
+ * for each format:
+ *
+ * RFC1950 zlib w/ deflate : 0www1000 : 0 <= www <= 7
+ * Experimental pack-based : Stttssss : ttt = 1,2,3,4
+ *
+ * If bit 7 is clear and bits 0-3 equal 8, the buffer MUST be
+ * in standard loose-object format, UNLESS it is a Git-pack
+ * format object *exactly* 8 bytes in size when inflated.
+ *
+ * However, RFC1950 also specifies that the 1st 16-bit word
+ * must be divisible by 31 - this checksum tells us our buffer
+ * is in the standard format, giving a false positive only if
+ * the 1st word of the Git-pack format object happens to be
+ * divisible by 31, ie:
+ * ((byte0 * 256) + byte1) % 31 = 0
+ * => 0ttt10000www1000 % 31 = 0
+ *
+ * As it happens, this case can only arise for www=3 & ttt=1
+ * - ie, a Commit object, which would have to be 8 bytes in
+ * size. As no Commit can be that small, we find that the
+ * combination of these two criteria (bitmask & checksum)
+ * can always correctly determine the buffer format.
*/
word = (map[0] << 8) + map[1];
- if (map[0] == 0x78 && !(word % 31))
+ if ((map[0] & 0x8F) == 0x08 && !(word % 31))
return 0;
else
return 1;
diff --git a/t/t1013-loose-object-format.sh b/t/t1013-loose-object-format.sh
new file mode 100755
index 0000000..b5ac46d
--- /dev/null
+++ b/t/t1013-loose-object-format.sh
@@ -0,0 +1,66 @@
+#!/bin/sh
+#
+# Copyright (c) 2011 Roberto Tyley
+#
+
+test_description='Correctly identify and parse loose object headers
+
+There are two file formats for loose objects - the original standard
+format, and the experimental format introduced with Git v1.4.3, later
+deprecated with v1.5.3. Although Git no longer writes the
+experimental format, objects in both formats must be read, with the
+format for a given file being determined by the header.
+
+Detecting file format based on header is not entirely trivial, not
+least because the first byte of a zlib-deflated stream will vary
+depending on how much memory was allocated for the deflation window
+buffer when the object was written out (for example 4KB on Android,
+rather that 32KB on a normal PC).
+
+The loose objects used as test vectors have been generated with the
+following Git versions:
+
+standard format: Git v1.7.4.1
+experimental format: Git v1.4.3 (legacyheaders=false)
+standard format, deflated with 4KB window size: Agit/JGit on Android
+'
+
+. ./test-lib.sh
+
+assert_blob_equals() {
+ echo -n $2 > expected &&
+ git cat-file -p $1 > actual &&
+ test_cmp expected actual
+}
+
+test_expect_success setup '
+ cp -R ../t1013/objects .git/
+ git --version
+'
+
+test_expect_success 'read standard-format loose objects' '
+ git cat-file tag 8d4e360d6c70fbd72411991c02a09c442cf7a9fa &&
+ git cat-file commit 6baee0540ea990d9761a3eb9ab183003a71c3696 &&
+ git ls-tree 7a37b887a73791d12d26c0d3e39568a8fb0fa6e8 &&
+ assert_blob_equals "257cc5642cb1a054f08cc83f2d943e56fd3ebe99" "foo\n"
+'
+
+test_expect_success 'read experimental-format loose objects' '
+ git cat-file tag 76e7fa9941f4d5f97f64fea65a2cba436bc79cbb &&
+ git cat-file commit 7875c6237d3fcdd0ac2f0decc7d3fa6a50b66c09 &&
+ git ls-tree 95b1625de3ba8b2214d1e0d0591138aea733f64f &&
+ assert_blob_equals "2e65efe2a145dda7ee51d1741299f848e5bf752e" "a" &&
+ assert_blob_equals "9ae9e86b7bd6cb1472d9373702d8249973da0832" "ab" &&
+ assert_blob_equals "85df50785d62d3b05ab03d9cbf7e4a0b49449730" "abcd" &&
+ assert_blob_equals "1656f9233d999f61ef23ef390b9c71d75399f435" "abcdefgh" &&
+ assert_blob_equals "1e72a6b2c4a577ab0338860fa9fe87f761fc9bbd" "abcdefghi" &&
+ assert_blob_equals "70e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd" "abcdefghijklmnop" &&
+ assert_blob_equals "bd15045f6ce8ff75747562173640456a394412c8" "abcdefghijklmnopqrstuvwx"
+'
+
+test_expect_success 'read standard-format objects deflated with smaller window buffer' '
+ git cat-file tag f816d5255855ac160652ee5253b06cd8ee14165a &&
+ git cat-file tag 149cedb5c46929d18e0f118e9fa31927487af3b6
+'
+
+test_done
diff --git a/t/t1013/objects/14/9cedb5c46929d18e0f118e9fa31927487af3b6 b/t/t1013/objects/14/9cedb5c46929d18e0f118e9fa31927487af3b6
new file mode 100644
index 0000000000000000000000000000000000000000..472fd1458e03e47136416bce60d6e7c893a468ab
GIT binary patch
literal 117
zcmV-*0E+)ei51K-4#F@DKvCwL!aJ&DH^jjbLR`g3tWwmHs(9h{l<n&c-*p0_eCp+8
z)q#teVY;BH2sX(~8m)*Hx<<sPnQCO=;NQ)l_H~^-`0>zp+xy&xqlfV?lkEVv$I`1V
X&;Ic{P^6Jl5+pbyA%^e+FOeitJb^w>
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/16/56f9233d999f61ef23ef390b9c71d75399f435 b/t/t1013/objects/16/56f9233d999f61ef23ef390b9c71d75399f435
new file mode 100644
index 0000000000000000000000000000000000000000..c379d74ae2b40faae9c31cb7478bc7f42a6fb13c
GIT binary patch
literal 17
YcmcDhnB(o^<>%?^eV&1VkAYbg05K>8VgLXD
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/1e/72a6b2c4a577ab0338860fa9fe87f761fc9bbd b/t/t1013/objects/1e/72a6b2c4a577ab0338860fa9fe87f761fc9bbd
new file mode 100644
index 0000000000000000000000000000000000000000..93706305bcff060547181ee4b7d3a8583b691181
GIT binary patch
literal 18
ZcmcDlnB(o^<>%?^ef|UsgJ2(X9{@cS1}Ojl
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99 b/t/t1013/objects/25/7cc5642cb1a054f08cc83f2d943e56fd3ebe99
new file mode 100644
index 0000000000000000000000000000000000000000..bdcf704c9e663f3a11b3146b1b455bc2581b4761
GIT binary patch
literal 19
acmb<m^geacKgb}_<MjFGObnu-%uWDJxd#LQ
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/2e/65efe2a145dda7ee51d1741299f848e5bf752e b/t/t1013/objects/2e/65efe2a145dda7ee51d1741299f848e5bf752e
new file mode 100644
index 0000000000000000000000000000000000000000..ad62c43e418c11254cede4dc94982ac6a30dbe9c
GIT binary patch
literal 10
RcmXr4nB&dDz>vg{1ON`X0$Bh6
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/6b/aee0540ea990d9761a3eb9ab183003a71c3696 b/t/t1013/objects/6b/aee0540ea990d9761a3eb9ab183003a71c3696
new file mode 100644
index 0000000000000000000000000000000000000000..3d2f0337dbb64c092b4a7e9bd324a66986cfe01a
GIT binary patch
literal 181
zcmV;m080OO0i}>jY6CG41+&&EdLIz_c+?s&#*jt!#uw=6?r{d&BO_}9zP*3BL6-Fv
zMe(?t&r^etx{p>>0V(2;GZIGZz4#y@v6HB=?^32b4sN8R*<7gV+yFCnoI*s2Ba1lV
zFgj7@=Rk=%H>8K4H?*{$QejsHt*yZRcG4TH>l<x*;`Xpmm5FA{#V*GU_~=6l7@~(y
j=bbbBs%`pTkNNr&2`txXKEU_mgI{mauB<nAL=six5bRpF
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/70/e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd b/t/t1013/objects/70/e6a83d8dcb26fc8bc0cf702e2ddeb6adca18fd
new file mode 100644
index 0000000000000000000000000000000000000000..b3f71a6ee5802b36b4576c5ebf111f30ef2017a4
GIT binary patch
literal 26
icmdnMSTV=j$IH*t*Zcg5GpEj-JbPN7fx*mytrGyBA`4~!
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/76/e7fa9941f4d5f97f64fea65a2cba436bc79cbb b/t/t1013/objects/76/e7fa9941f4d5f97f64fea65a2cba436bc79cbb
new file mode 100644
index 0000000000000000000000000000000000000000..af4e9a7b0c035fc7c26355b85f250f3ff7d3afa1
GIT binary patch
literal 155
zcmV;M0A&Bd3wWF*%s~!<Fc3h|eNQoaV^dlvm>A>Ez2O4GbZDxSl3I-1-k{6>7C#LS
zrUGr(He|JFof*kFg``L2m}m#I*r>r;QYTTig@ICxp@@PW__J^hk>`TbaZEYl&pl_j
zr-5@x&~FoOaL)gfWzVZ$F}r}Xq$Jnp1u9c%tLsj8a8Q*}LiGE^!TJibhg&G{u4FBZ
J_yWO9IpM14O;`W`
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/78/75c6237d3fcdd0ac2f0decc7d3fa6a50b66c09 b/t/t1013/objects/78/75c6237d3fcdd0ac2f0decc7d3fa6a50b66c09
new file mode 100644
index 0000000000000000000000000000000000000000..3dd28be5c61840c23486bc654213c493c5387d75
GIT binary patch
literal 139
zcmV;60CfM64S1ZT%u5QwFc1LHeNHiZA!PEi1rc|y+=v&LG*cUF4TP!E+lzPvmv8f=
zF+(2`MjJA_L|w8LeMUCfgdWj##I$#AjDA$K%2XR%YvLvqZrjWo9NLdszC7JmYPrx;
t4^^*^BcMYYt&hRN&Y&@BsLN7B_}@oeC^Ni^OmHp&FVtQ;^#LMbK`4x{Jre)`
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/7a/37b887a73791d12d26c0d3e39568a8fb0fa6e8 b/t/t1013/objects/7a/37b887a73791d12d26c0d3e39568a8fb0fa6e8
new file mode 100644
index 0000000000000000000000000000000000000000..2b97b264c33f78fe6c8230b5bbeacd6409d9f963
GIT binary patch
literal 54
zcmV-60LlM&0V^p=O;s>9XD~D{Ff%bx2yqP#(RK6mab-}gIhvxgaY4w3o)h-EQ|!Y2
M+U=VO05jJR92g)Lz5oCK
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/85/df50785d62d3b05ab03d9cbf7e4a0b49449730 b/t/t1013/objects/85/df50785d62d3b05ab03d9cbf7e4a0b49449730
new file mode 100644
index 0000000000000000000000000000000000000000..6dff746876aab1acb9b42c557cdda69164d68398
GIT binary patch
literal 13
UcmXr1nB(o^<;Tdte1owY030|2-~a#s
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/8d/4e360d6c70fbd72411991c02a09c442cf7a9fa b/t/t1013/objects/8d/4e360d6c70fbd72411991c02a09c442cf7a9fa
new file mode 100644
index 0000000000000000000000000000000000000000..cb41e92d076c191245389bedfc0184ff78511c03
GIT binary patch
literal 156
zcmV;N0Av4n0VRw<3c@fD06pgwdly5tsfhs*Z{DRJ*tBb?+D6i?(BE72I0G|63DCPu
zj(2VaTqI_*uMJZOrVHL7S&o4s9;`8zJhs*ar(}6Cw0RhMQL;WJp|PXV?QXdY^mB;|
zTyx|i8JgwE3mnTIwS4iM<~8VP)NR)D;{<52a+SALfUQAelxip??qHt!F~Ox5c%$~Z
K)~G%MG&zg-a!8y2
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/95/b1625de3ba8b2214d1e0d0591138aea733f64f b/t/t1013/objects/95/b1625de3ba8b2214d1e0d0591138aea733f64f
new file mode 100644
index 0000000000000000000000000000000000000000..7ac46b4f703aa00cd96c42971a237e3da5bbb5ca
GIT binary patch
literal 252
zcmV<Y00aN25_p_5G%zqTF;Pg(OwTCME2$`95DWXMY&&y);(O)ymfUj+uLsZkVrmFc
zl$Kvw1Xj~}KcFHu>GFoC4YqUk*LiV!x=c5Ks>#dDO9iWuD_XYc$kOuF%oc6@EC02B
zPy91`FH}uFREb{d`$r31?=F8Ac(Fui<`0jj`%CqpN{TZpN>Wqvz{(1qt+4Gqt@fw;
z!1)3_-Fw^Co|5<rRaR1-npaY(3wPLFQI`0e7ynC3N|VIR99*+3U4%}+mF9z$%zF7E
zyZYK`k)oUC=1ezKW)|P#FoG(nN-ct@c{caa>`fQ1IeT|&t}Bnaap*};@I(N)b$dQ6
C6@X{}
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/9a/e9e86b7bd6cb1472d9373702d8249973da0832 b/t/t1013/objects/9a/e9e86b7bd6cb1472d9373702d8249973da0832
new file mode 100644
index 0000000000000000000000000000000000000000..9d8316d4e598e32ef17b3918cf00276c8c1bffba
GIT binary patch
literal 11
ScmXr2nB(ok#K5S=a0CDn4+6^o
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/bd/15045f6ce8ff75747562173640456a394412c8 b/t/t1013/objects/bd/15045f6ce8ff75747562173640456a394412c8
new file mode 100644
index 0000000000000000000000000000000000000000..eebf23956e3b8ac736fa04e682b4214ac75c716a
GIT binary patch
literal 34
qcmdnNSTV=j$IH*t*Zcg5GpEj-JbPMSLq|(bQ&)RE14GpTE?oczGYz%?
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 b/t/t1013/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391
new file mode 100644
index 0000000000000000000000000000000000000000..134cf1937963c733d7affa6919f9835db864188a
GIT binary patch
literal 9
OcmXr0n8VBf1dIR)&;dyR
literal 0
HcmV?d00001
diff --git a/t/t1013/objects/f8/16d5255855ac160652ee5253b06cd8ee14165a b/t/t1013/objects/f8/16d5255855ac160652ee5253b06cd8ee14165a
new file mode 100644
index 0000000000000000000000000000000000000000..26b75aec56f8f178a9f001be3b630a4e48ceb6b9
GIT binary patch
literal 116
zcmV-)0E_=fi51Mj4uUWYfML&jirx)LyJa0F#`r3w9f$!(uovH6xc&JKzsm$f<<f?C
zRfp1-tQ=FZG^!bj#u2Tmo**n42WG`v@ZVNJ+q%vk{CLR6_BLC0bVsL5bqBaVm!`73
W+SeaIi6Uq0dxk3#VhDeEz9mhO%Qr3n
literal 0
HcmV?d00001
--
1.7.4.1
^ permalink raw reply related
* add remote branch permanently
From: JuanPablo AJ @ 2011-08-07 19:44 UTC (permalink / raw)
To: git
Hi,
when I add a remote branch
$ git remote add otherUser git_repo_url
this is added locally configuration, how I can add this remote
branches configuration permanently similar to submodules ?
Regards.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).