Merge branch 'maint-1.5.1' into maint
* maint-1.5.1: Fix git-svn to handle svn not reporting the md5sum of a file, and test. More echo "$user_message" fixes. Add tests for the last two fixes. git-commit: use printf '%s\n' instead of echo on user-supplied strings git-am: use printf instead of echo on user-supplied strings Documentation: Add definition of "evil merge" to GIT Glossary Replace the last 'dircache's by 'index' Documentation: Clean up links in GIT Glossary
This commit is contained in:
@ -124,7 +124,7 @@ which case it outputs:
|
|||||||
detailed information on unmerged paths.
|
detailed information on unmerged paths.
|
||||||
|
|
||||||
For an unmerged path, instead of recording a single mode/SHA1 pair,
|
For an unmerged path, instead of recording a single mode/SHA1 pair,
|
||||||
the dircache records up to three such pairs; one from tree O in stage
|
the index records up to three such pairs; one from tree O in stage
|
||||||
1, A in stage 2, and B in stage 3. This information can be used by
|
1, A in stage 2, and B in stage 3. This information can be used by
|
||||||
the user (or the porcelain) to see what should eventually be recorded at the
|
the user (or the porcelain) to see what should eventually be recorded at the
|
||||||
path. (see git-read-tree for more information on state)
|
path. (see git-read-tree for more information on state)
|
||||||
|
@ -10,7 +10,7 @@ GIT Glossary
|
|||||||
A bare repository is normally an appropriately
|
A bare repository is normally an appropriately
|
||||||
named <<def_directory,directory>> with a `.git` suffix that does not
|
named <<def_directory,directory>> with a `.git` suffix that does not
|
||||||
have a locally checked-out copy of any of the files under
|
have a locally checked-out copy of any of the files under
|
||||||
<<def_revision,revision>> control. That is, all of the `git`
|
revision control. That is, all of the `git`
|
||||||
administrative and control files that would normally be present in the
|
administrative and control files that would normally be present in the
|
||||||
hidden `.git` sub-directory are directly present in the
|
hidden `.git` sub-directory are directly present in the
|
||||||
`repository.git` directory instead,
|
`repository.git` directory instead,
|
||||||
@ -37,7 +37,7 @@ GIT Glossary
|
|||||||
[[def_chain]]chain::
|
[[def_chain]]chain::
|
||||||
A list of objects, where each <<def_object,object>> in the list contains
|
A list of objects, where each <<def_object,object>> in the list contains
|
||||||
a reference to its successor (for example, the successor of a
|
a reference to its successor (for example, the successor of a
|
||||||
<<def_commit,commit>> could be one of its parents).
|
<<def_commit,commit>> could be one of its <<def_parent,parents>>).
|
||||||
|
|
||||||
[[def_changeset]]changeset::
|
[[def_changeset]]changeset::
|
||||||
BitKeeper/cvsps speak for "<<def_commit,commit>>". Since git does not
|
BitKeeper/cvsps speak for "<<def_commit,commit>>". Since git does not
|
||||||
@ -77,10 +77,10 @@ to point at the new commit.
|
|||||||
|
|
||||||
[[def_commit_object]]commit object::
|
[[def_commit_object]]commit object::
|
||||||
An <<def_object,object>> which contains the information about a
|
An <<def_object,object>> which contains the information about a
|
||||||
particular <<def_revision,revision>>, such as parents, committer,
|
particular <<def_revision,revision>>, such as <<def_parent,parents>>, committer,
|
||||||
author, date and the <<def_tree_object,tree object>> which corresponds
|
author, date and the <<def_tree_object,tree object>> which corresponds
|
||||||
to the top <<def_directory,directory>> of the stored
|
to the top <<def_directory,directory>> of the stored
|
||||||
<<def_revision,revision>>.
|
revision.
|
||||||
|
|
||||||
[[def_core_git]]core git::
|
[[def_core_git]]core git::
|
||||||
Fundamental data structures and utilities of git. Exposes only limited
|
Fundamental data structures and utilities of git. Exposes only limited
|
||||||
@ -101,19 +101,19 @@ to point at the new commit.
|
|||||||
|
|
||||||
[[def_detached_HEAD]]detached HEAD::
|
[[def_detached_HEAD]]detached HEAD::
|
||||||
Normally the <<def_HEAD,HEAD>> stores the name of a
|
Normally the <<def_HEAD,HEAD>> stores the name of a
|
||||||
<<def_branch,branch>>. However, git also allows you to check
|
<<def_branch,branch>>. However, git also allows you to <<def_checkout,check out>>
|
||||||
out an arbitrary commit that isn't necessarily the tip of any
|
an arbitrary <<def_commit,commit>> that isn't necessarily the tip of any
|
||||||
particular branch. In this case HEAD is said to be "detached".
|
particular branch. In this case HEAD is said to be "detached".
|
||||||
|
|
||||||
[[def_dircache]]dircache::
|
[[def_dircache]]dircache::
|
||||||
You are *waaaaay* behind.
|
You are *waaaaay* behind. See <<def_index,index>>.
|
||||||
|
|
||||||
[[def_directory]]directory::
|
[[def_directory]]directory::
|
||||||
The list you get with "ls" :-)
|
The list you get with "ls" :-)
|
||||||
|
|
||||||
[[def_dirty]]dirty::
|
[[def_dirty]]dirty::
|
||||||
A <<def_working_tree,working tree>> is said to be "dirty" if
|
A <<def_working_tree,working tree>> is said to be "dirty" if
|
||||||
it contains modifications which have not been committed to the current
|
it contains modifications which have not been <<def_commit,committed>> to the current
|
||||||
<<def_branch,branch>>.
|
<<def_branch,branch>>.
|
||||||
|
|
||||||
[[def_ent]]ent::
|
[[def_ent]]ent::
|
||||||
@ -121,6 +121,10 @@ to point at the new commit.
|
|||||||
`http://en.wikipedia.org/wiki/Ent_(Middle-earth)` for an in-depth
|
`http://en.wikipedia.org/wiki/Ent_(Middle-earth)` for an in-depth
|
||||||
explanation. Avoid this term, not to confuse people.
|
explanation. Avoid this term, not to confuse people.
|
||||||
|
|
||||||
|
[[def_evil_merge]]evil merge::
|
||||||
|
An evil merge is a <<def_merge,merge>> that introduces changes that
|
||||||
|
do not appear in any <<def_parent,parent>>.
|
||||||
|
|
||||||
[[def_fast_forward]]fast forward::
|
[[def_fast_forward]]fast forward::
|
||||||
A fast-forward is a special type of <<def_merge,merge>> where you have a
|
A fast-forward is a special type of <<def_merge,merge>> where you have a
|
||||||
<<def_revision,revision>> and you are "merging" another
|
<<def_revision,revision>> and you are "merging" another
|
||||||
@ -149,7 +153,7 @@ to point at the new commit.
|
|||||||
[[def_grafts]]grafts::
|
[[def_grafts]]grafts::
|
||||||
Grafts enables two otherwise different lines of development to be joined
|
Grafts enables two otherwise different lines of development to be joined
|
||||||
together by recording fake ancestry information for commits. This way
|
together by recording fake ancestry information for commits. This way
|
||||||
you can make git pretend the set of parents a <<def_commit,commit>> has
|
you can make git pretend the set of <<def_parent,parents>> a <<def_commit,commit>> has
|
||||||
is different from what was recorded when the commit was
|
is different from what was recorded when the commit was
|
||||||
created. Configured via the `.git/info/grafts` file.
|
created. Configured via the `.git/info/grafts` file.
|
||||||
|
|
||||||
@ -157,13 +161,13 @@ to point at the new commit.
|
|||||||
In git's context, synonym to <<def_object_name,object name>>.
|
In git's context, synonym to <<def_object_name,object name>>.
|
||||||
|
|
||||||
[[def_head]]head::
|
[[def_head]]head::
|
||||||
A named reference to the <<def_commit,commit>> at the tip of a
|
A <<def_ref,named reference>> to the <<def_commit,commit>> at the tip of a
|
||||||
<<def_branch,branch>>. Heads are stored in
|
<<def_branch,branch>>. Heads are stored in
|
||||||
`$GIT_DIR/refs/heads/`, except when using packed refs. (See
|
`$GIT_DIR/refs/heads/`, except when using packed refs. (See
|
||||||
gitlink:git-pack-refs[1].)
|
gitlink:git-pack-refs[1].)
|
||||||
|
|
||||||
[[def_HEAD]]HEAD::
|
[[def_HEAD]]HEAD::
|
||||||
The current branch. In more detail: Your <<def_working_tree,
|
The current <<def_branch,branch>>. In more detail: Your <<def_working_tree,
|
||||||
working tree>> is normally derived from the state of the tree
|
working tree>> is normally derived from the state of the tree
|
||||||
referred to by HEAD. HEAD is a reference to one of the
|
referred to by HEAD. HEAD is a reference to one of the
|
||||||
<<def_head,heads>> in your repository, except when using a
|
<<def_head,heads>> in your repository, except when using a
|
||||||
@ -179,15 +183,15 @@ to point at the new commit.
|
|||||||
checking. Typically, the hooks allow for a command to be pre-verified
|
checking. Typically, the hooks allow for a command to be pre-verified
|
||||||
and potentially aborted, and allow for a post-notification after the
|
and potentially aborted, and allow for a post-notification after the
|
||||||
operation is done. The hook scripts are found in the
|
operation is done. The hook scripts are found in the
|
||||||
`$GIT_DIR/hooks/` <<def_directory,directory>>, and are enabled by simply
|
`$GIT_DIR/hooks/` directory, and are enabled by simply
|
||||||
making them executable.
|
making them executable.
|
||||||
|
|
||||||
[[def_index]]index::
|
[[def_index]]index::
|
||||||
A collection of files with stat information, whose contents are stored
|
A collection of files with stat information, whose contents are stored
|
||||||
as objects. The index is a stored version of your working
|
as objects. The index is a stored version of your
|
||||||
<<def_tree,tree>>. Truth be told, it can also contain a second, and even
|
<<def_working_tree,working tree>>. Truth be told, it can also contain a second, and even
|
||||||
a third version of a <<def_working_tree,working tree>>, which are used
|
a third version of a working tree, which are used
|
||||||
when merging.
|
when <<def_merge,merging>>.
|
||||||
|
|
||||||
[[def_index_entry]]index entry::
|
[[def_index_entry]]index entry::
|
||||||
The information regarding a particular file, stored in the
|
The information regarding a particular file, stored in the
|
||||||
@ -249,16 +253,16 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
describing the type of an <<def_object,object>>.
|
describing the type of an <<def_object,object>>.
|
||||||
|
|
||||||
[[def_octopus]]octopus::
|
[[def_octopus]]octopus::
|
||||||
To <<def_merge,merge>> more than two branches. Also denotes an
|
To <<def_merge,merge>> more than two <<def_branch,branches>>. Also denotes an
|
||||||
intelligent predator.
|
intelligent predator.
|
||||||
|
|
||||||
[[def_origin]]origin::
|
[[def_origin]]origin::
|
||||||
The default upstream <<def_repository,repository>>. Most projects have
|
The default upstream <<def_repository,repository>>. Most projects have
|
||||||
at least one upstream project which they track. By default
|
at least one upstream project which they track. By default
|
||||||
'origin' is used for that purpose. New upstream updates
|
'origin' is used for that purpose. New upstream updates
|
||||||
will be fetched into remote tracking branches named
|
will be fetched into remote <<def_tracking_branch,tracking branches>> named
|
||||||
origin/name-of-upstream-branch, which you can see using
|
origin/name-of-upstream-branch, which you can see using
|
||||||
"git <<def_branch,branch>> -r".
|
"`git branch -r`".
|
||||||
|
|
||||||
[[def_pack]]pack::
|
[[def_pack]]pack::
|
||||||
A set of objects which have been compressed into one file (to save space
|
A set of objects which have been compressed into one file (to save space
|
||||||
@ -327,7 +331,7 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
`$GIT_DIR/refs/`.
|
`$GIT_DIR/refs/`.
|
||||||
|
|
||||||
[[def_refspec]]refspec::
|
[[def_refspec]]refspec::
|
||||||
A <<def_refspec,refspec>> is used by <<def_fetch,fetch>> and
|
A "refspec" is used by <<def_fetch,fetch>> and
|
||||||
<<def_push,push>> to describe the mapping between remote
|
<<def_push,push>> to describe the mapping between remote
|
||||||
<<def_ref,ref>> and local ref. They are combined with a colon in
|
<<def_ref,ref>> and local ref. They are combined with a colon in
|
||||||
the format <src>:<dst>, preceded by an optional plus sign, +.
|
the format <src>:<dst>, preceded by an optional plus sign, +.
|
||||||
@ -340,11 +344,12 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
gitlink:git-push[1]
|
gitlink:git-push[1]
|
||||||
|
|
||||||
[[def_repository]]repository::
|
[[def_repository]]repository::
|
||||||
A collection of refs together with an
|
A collection of <<def_ref,refs>> together with an
|
||||||
<<def_object_database,object database>> containing all objects
|
<<def_object_database,object database>> containing all objects
|
||||||
which are <<def_reachable,reachable>> from the refs, possibly
|
which are <<def_reachable,reachable>> from the refs, possibly
|
||||||
accompanied by meta data from one or more porcelains. A
|
accompanied by meta data from one or more <<def_porcelain,porcelains>>. A
|
||||||
repository can share an object database with other repositories.
|
repository can share an object database with other repositories
|
||||||
|
via <<def_alternate_object_database,alternates mechanism>>.
|
||||||
|
|
||||||
[[def_resolve]]resolve::
|
[[def_resolve]]resolve::
|
||||||
The action of fixing up manually what a failed automatic
|
The action of fixing up manually what a failed automatic
|
||||||
@ -366,8 +371,8 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
Synonym for <<def_object_name,object name>>.
|
Synonym for <<def_object_name,object name>>.
|
||||||
|
|
||||||
[[def_shallow_repository]]shallow repository::
|
[[def_shallow_repository]]shallow repository::
|
||||||
A shallow repository has an incomplete
|
A shallow <<def_repository,repository>> has an incomplete
|
||||||
history some of whose commits have parents cauterized away (in other
|
history some of whose <<def_commit,commits>> have <<def_parent,parents>> cauterized away (in other
|
||||||
words, git is told to pretend that these commits do not have the
|
words, git is told to pretend that these commits do not have the
|
||||||
parents, even though they are recorded in the <<def_commit_object,commit
|
parents, even though they are recorded in the <<def_commit_object,commit
|
||||||
object>>). This is sometimes useful when you are interested only in the
|
object>>). This is sometimes useful when you are interested only in the
|
||||||
@ -385,7 +390,7 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
command.
|
command.
|
||||||
|
|
||||||
[[def_tag]]tag::
|
[[def_tag]]tag::
|
||||||
A <<def_ref,ref>> pointing to a tag or
|
A <<def_ref,ref>> pointing to a <<def_tag_object,tag>> or
|
||||||
<<def_commit_object,commit object>>. In contrast to a <<def_head,head>>,
|
<<def_commit_object,commit object>>. In contrast to a <<def_head,head>>,
|
||||||
a tag is not changed by a <<def_commit,commit>>. Tags (not
|
a tag is not changed by a <<def_commit,commit>>. Tags (not
|
||||||
<<def_tag_object,tag objects>>) are stored in `$GIT_DIR/refs/tags/`. A
|
<<def_tag_object,tag objects>>) are stored in `$GIT_DIR/refs/tags/`. A
|
||||||
@ -398,8 +403,7 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
An <<def_object,object>> containing a <<def_ref,ref>> pointing to
|
An <<def_object,object>> containing a <<def_ref,ref>> pointing to
|
||||||
another object, which can contain a message just like a
|
another object, which can contain a message just like a
|
||||||
<<def_commit_object,commit object>>. It can also contain a (PGP)
|
<<def_commit_object,commit object>>. It can also contain a (PGP)
|
||||||
signature, in which case it is called a "signed <<def_tag_object,tag
|
signature, in which case it is called a "signed tag object".
|
||||||
object>>".
|
|
||||||
|
|
||||||
[[def_topic_branch]]topic branch::
|
[[def_topic_branch]]topic branch::
|
||||||
A regular git <<def_branch,branch>> that is used by a developer to
|
A regular git <<def_branch,branch>> that is used by a developer to
|
||||||
@ -418,7 +422,7 @@ This commit is referred to as a "merge commit", or sometimes just a
|
|||||||
|
|
||||||
[[def_tree]]tree::
|
[[def_tree]]tree::
|
||||||
Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree
|
Either a <<def_working_tree,working tree>>, or a <<def_tree_object,tree
|
||||||
object>> together with the dependent blob and tree objects
|
object>> together with the dependent <<def_blob_object,blob>> and tree objects
|
||||||
(i.e. a stored representation of a working tree).
|
(i.e. a stored representation of a working tree).
|
||||||
|
|
||||||
[[def_tree_object]]tree object::
|
[[def_tree_object]]tree object::
|
||||||
|
2
diff.c
2
diff.c
@ -1349,7 +1349,7 @@ void fill_filespec(struct diff_filespec *spec, const unsigned char *sha1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Given a name and sha1 pair, if the dircache tells us the file in
|
* Given a name and sha1 pair, if the index tells us the file in
|
||||||
* the work tree has that object contents, return true, so that
|
* the work tree has that object contents, return true, so that
|
||||||
* prepare_temp_file() does not have to inflate and extract.
|
* prepare_temp_file() does not have to inflate and extract.
|
||||||
*/
|
*/
|
||||||
|
@ -18,7 +18,7 @@ stop_here () {
|
|||||||
|
|
||||||
stop_here_user_resolve () {
|
stop_here_user_resolve () {
|
||||||
if [ -n "$resolvemsg" ]; then
|
if [ -n "$resolvemsg" ]; then
|
||||||
echo "$resolvemsg"
|
printf '%s\n' "$resolvemsg"
|
||||||
stop_here $1
|
stop_here $1
|
||||||
fi
|
fi
|
||||||
cmdline=$(basename $0)
|
cmdline=$(basename $0)
|
||||||
@ -146,7 +146,7 @@ do
|
|||||||
git_apply_opt="$git_apply_opt $1"; shift ;;
|
git_apply_opt="$git_apply_opt $1"; shift ;;
|
||||||
|
|
||||||
--resolvemsg=*)
|
--resolvemsg=*)
|
||||||
resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
|
resolvemsg=${1#--resolvemsg=}; shift ;;
|
||||||
|
|
||||||
--)
|
--)
|
||||||
shift; break ;;
|
shift; break ;;
|
||||||
@ -331,7 +331,7 @@ do
|
|||||||
ADD_SIGNOFF=
|
ADD_SIGNOFF=
|
||||||
fi
|
fi
|
||||||
{
|
{
|
||||||
echo "$SUBJECT"
|
printf '%s\n' "$SUBJECT"
|
||||||
if test -s "$dotest/msg-clean"
|
if test -s "$dotest/msg-clean"
|
||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
@ -394,7 +394,7 @@ do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Applying '$SUBJECT'"
|
printf 'Applying %s\n' "$SUBJECT"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
case "$resolved" in
|
case "$resolved" in
|
||||||
|
@ -376,12 +376,12 @@ t,)
|
|||||||
rm -f "$TMP_INDEX"
|
rm -f "$TMP_INDEX"
|
||||||
fi || exit
|
fi || exit
|
||||||
|
|
||||||
echo "$commit_only" |
|
printf '%s\n' "$commit_only" |
|
||||||
GIT_INDEX_FILE="$TMP_INDEX" \
|
GIT_INDEX_FILE="$TMP_INDEX" \
|
||||||
git-update-index --add --remove --stdin &&
|
git-update-index --add --remove --stdin &&
|
||||||
|
|
||||||
save_index &&
|
save_index &&
|
||||||
echo "$commit_only" |
|
printf '%s\n' "$commit_only" |
|
||||||
(
|
(
|
||||||
GIT_INDEX_FILE="$NEXT_INDEX"
|
GIT_INDEX_FILE="$NEXT_INDEX"
|
||||||
export GIT_INDEX_FILE
|
export GIT_INDEX_FILE
|
||||||
@ -432,7 +432,7 @@ fi
|
|||||||
|
|
||||||
if test "$log_message" != ''
|
if test "$log_message" != ''
|
||||||
then
|
then
|
||||||
echo "$log_message"
|
printf '%s\n' "$log_message"
|
||||||
elif test "$logfile" != ""
|
elif test "$logfile" != ""
|
||||||
then
|
then
|
||||||
if test "$logfile" = -
|
if test "$logfile" = -
|
||||||
@ -475,7 +475,7 @@ if test -f "$GIT_DIR/MERGE_HEAD" && test -z "$no_edit"; then
|
|||||||
echo "#"
|
echo "#"
|
||||||
echo "# It looks like you may be committing a MERGE."
|
echo "# It looks like you may be committing a MERGE."
|
||||||
echo "# If this is not correct, please remove the file"
|
echo "# If this is not correct, please remove the file"
|
||||||
echo "# $GIT_DIR/MERGE_HEAD"
|
printf '%s\n' "# $GIT_DIR/MERGE_HEAD"
|
||||||
echo "# and try again"
|
echo "# and try again"
|
||||||
echo "#"
|
echo "#"
|
||||||
fi >>"$GIT_DIR"/COMMIT_EDITMSG
|
fi >>"$GIT_DIR"/COMMIT_EDITMSG
|
||||||
|
@ -328,7 +328,7 @@ f,*)
|
|||||||
then
|
then
|
||||||
echo "Wonderful."
|
echo "Wonderful."
|
||||||
result_commit=$(
|
result_commit=$(
|
||||||
echo "$merge_msg" |
|
printf '%s\n' "$merge_msg" |
|
||||||
git-commit-tree $result_tree -p HEAD -p "$1"
|
git-commit-tree $result_tree -p HEAD -p "$1"
|
||||||
) || exit
|
) || exit
|
||||||
finish "$result_commit" "In-index merge"
|
finish "$result_commit" "In-index merge"
|
||||||
@ -433,7 +433,7 @@ done
|
|||||||
if test '' != "$result_tree"
|
if test '' != "$result_tree"
|
||||||
then
|
then
|
||||||
parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
|
parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
|
||||||
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
|
result_commit=$(printf '%s\n' "$merge_msg" | git-commit-tree $result_tree $parents) || exit
|
||||||
finish "$result_commit" "Merge made by $wt_strategy."
|
finish "$result_commit" "Merge made by $wt_strategy."
|
||||||
dropsave
|
dropsave
|
||||||
exit 0
|
exit 0
|
||||||
@ -472,7 +472,7 @@ else
|
|||||||
do
|
do
|
||||||
echo $remote
|
echo $remote
|
||||||
done >"$GIT_DIR/MERGE_HEAD"
|
done >"$GIT_DIR/MERGE_HEAD"
|
||||||
echo "$merge_msg" >"$GIT_DIR/MERGE_MSG"
|
printf '%s\n' "$merge_msg" >"$GIT_DIR/MERGE_MSG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$merge_was_ok" = t
|
if test "$merge_was_ok" = t
|
||||||
|
@ -2477,7 +2477,7 @@ sub close_file {
|
|||||||
$md5->addfile($fh);
|
$md5->addfile($fh);
|
||||||
my $got = $md5->hexdigest;
|
my $got = $md5->hexdigest;
|
||||||
die "Checksum mismatch: $path\n",
|
die "Checksum mismatch: $path\n",
|
||||||
"expected: $exp\n got: $got\n" if ($got ne $exp);
|
"expected: $exp\n got: $got\n" if (defined $exp && $got ne $exp);
|
||||||
sysseek($fh, 0, 0) or croak $!;
|
sysseek($fh, 0, 0) or croak $!;
|
||||||
if ($fb->{mode_b} == 120000) {
|
if ($fb->{mode_b} == 120000) {
|
||||||
sysread($fh, my $buf, 5) == 5 or croak $!;
|
sysread($fh, my $buf, 5) == 5 or croak $!;
|
||||||
|
@ -126,7 +126,7 @@ if [ "$annotate" ]; then
|
|||||||
echo "#" ) > "$GIT_DIR"/TAG_EDITMSG
|
echo "#" ) > "$GIT_DIR"/TAG_EDITMSG
|
||||||
${VISUAL:-${EDITOR:-vi}} "$GIT_DIR"/TAG_EDITMSG || exit
|
${VISUAL:-${EDITOR:-vi}} "$GIT_DIR"/TAG_EDITMSG || exit
|
||||||
else
|
else
|
||||||
echo "$message" >"$GIT_DIR"/TAG_EDITMSG
|
printf '%s\n' "$message" >"$GIT_DIR"/TAG_EDITMSG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
grep -v '^#' <"$GIT_DIR"/TAG_EDITMSG |
|
grep -v '^#' <"$GIT_DIR"/TAG_EDITMSG |
|
||||||
|
@ -16,16 +16,16 @@ test_expect_success setup '
|
|||||||
|
|
||||||
for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file &&
|
for i in 1 2 5 6 A B C 7 8 9 10; do echo "$i"; done >file &&
|
||||||
git update-index file &&
|
git update-index file &&
|
||||||
git commit -m "Side change #1" &&
|
git commit -m "Side changes #1" &&
|
||||||
|
|
||||||
for i in D E F; do echo "$i"; done >>file &&
|
for i in D E F; do echo "$i"; done >>file &&
|
||||||
git update-index file &&
|
git update-index file &&
|
||||||
git commit -m "Side change #2" &&
|
git commit -m "Side changes #2" &&
|
||||||
git tag C2 &&
|
git tag C2 &&
|
||||||
|
|
||||||
for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file &&
|
for i in 5 6 1 2 3 A 4 B C 7 8 9 10 D E F; do echo "$i"; done >file &&
|
||||||
git update-index file &&
|
git update-index file &&
|
||||||
git commit -m "Side change #3" &&
|
git commit -m "Side changes #3 with \\n backslash-n in it." &&
|
||||||
|
|
||||||
git checkout master &&
|
git checkout master &&
|
||||||
git diff-tree -p C2 | git apply --index &&
|
git diff-tree -p C2 | git apply --index &&
|
||||||
@ -66,4 +66,23 @@ test_expect_success "format-patch --ignore-if-in-upstream result applies" '
|
|||||||
test $cnt = 2
|
test $cnt = 2
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'commit did not screw up the log message' '
|
||||||
|
|
||||||
|
git cat-file commit side | grep "^Side .* with .* backslash-n"
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'format-patch did not screw up the log message' '
|
||||||
|
|
||||||
|
grep "^Subject: .*Side changes #3 with .* backslash-n" patch0 &&
|
||||||
|
grep "^Subject: .*Side changes #3 with .* backslash-n" patch1
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
|
test_expect_success 'replay did not screw up the log message' '
|
||||||
|
|
||||||
|
git cat-file commit rebuild-1 | grep "^Side .* with .* backslash-n"
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
45
t/t9112-git-svn-md5less-file.sh
Executable file
45
t/t9112-git-svn-md5less-file.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
test_description='test that git handles an svn repository with missing md5sums'
|
||||||
|
|
||||||
|
. ./lib-git-svn.sh
|
||||||
|
|
||||||
|
# Loading a node from a svn dumpfile without a Text-Content-Length
|
||||||
|
# field causes svn to neglect to store or report an md5sum. (it will
|
||||||
|
# calculate one if you had put Text-Content-Length: 0). This showed
|
||||||
|
# up in a repository creted with cvs2svn.
|
||||||
|
|
||||||
|
cat > dumpfile.svn <<EOF
|
||||||
|
SVN-fs-dump-format-version: 1
|
||||||
|
|
||||||
|
Revision-number: 1
|
||||||
|
Prop-content-length: 98
|
||||||
|
Content-length: 98
|
||||||
|
|
||||||
|
K 7
|
||||||
|
svn:log
|
||||||
|
V 0
|
||||||
|
|
||||||
|
K 10
|
||||||
|
svn:author
|
||||||
|
V 4
|
||||||
|
test
|
||||||
|
K 8
|
||||||
|
svn:date
|
||||||
|
V 27
|
||||||
|
2007-05-06T12:37:01.153339Z
|
||||||
|
PROPS-END
|
||||||
|
|
||||||
|
Node-path: md5less-file
|
||||||
|
Node-kind: file
|
||||||
|
Node-action: add
|
||||||
|
Prop-content-length: 10
|
||||||
|
Content-length: 10
|
||||||
|
|
||||||
|
PROPS-END
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
|
test_expect_success 'load svn dumpfile' "svnadmin load $rawsvnrepo < dumpfile.svn"
|
||||||
|
|
||||||
|
test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
|
||||||
|
test_expect_success 'fetch revisions from svn' 'git-svn fetch'
|
||||||
|
test_done
|
Reference in New Issue
Block a user