Merge branch 'sp/reflog' into next

* sp/reflog:
  Log ref changes made by resolve.
  Log ref changes made by quiltimport.
  Log ref changes made by git-merge and git-pull.
  git-fetch: fix a bashism (==)
  Make the unpacked object header functions static to sha1_file.c
  git-send-email: Remove redundant Reply-To header
  typofix (git-name-rev documentation)
  Mention the [user@] part in documentation of ssh:// urls.
  tests: Set EDITOR=: and VISUAL=: globally
This commit is contained in:
Junio C Hamano
2006-07-11 14:21:48 -07:00
14 changed files with 34 additions and 20 deletions

View File

@@ -33,7 +33,7 @@ EXAMPLE
-------
Given a commit, find out where it is relative to the local refs. Say somebody
wrote you about that phantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a.
Of course, you look into the commit, but that only tells you what happened, but
not the context.

View File

@@ -10,9 +10,9 @@ to name the remote repository:
- https://host.xz/path/to/repo.git/
- git://host.xz/path/to/repo.git/
- git://host.xz/~user/path/to/repo.git/
- ssh://host.xz/path/to/repo.git/
- ssh://host.xz/~user/path/to/repo.git/
- ssh://host.xz/~/path/to/repo.git
- ssh://[user@]host.xz/path/to/repo.git/
- ssh://[user@]host.xz/~user/path/to/repo.git/
- ssh://[user@]host.xz/~/path/to/repo.git
===============================================================
SSH Is the default transport protocol and also supports an

View File

@@ -219,8 +219,6 @@ int safe_create_leading_directories(char *path);
char *enter_repo(char *path, int strict);
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
extern int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size);
extern int parse_sha1_header(char *hdr, char *type, unsigned long *sizep);
extern int sha1_object_info(const unsigned char *, char *, unsigned long *);
extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size);
extern void * read_sha1_file(const unsigned char *sha1, char *type, unsigned long *size);

View File

@@ -80,7 +80,7 @@ rref=
rsync_slurped_objects=
rloga="$rloga $remote_nick"
test "$remote_nick" == "$remote" || rloga="$rloga $remote"
test "$remote_nick" = "$remote" || rloga="$rloga $remote"
if test "" = "$append"
then

View File

@@ -58,7 +58,13 @@ squash_message () {
}
finish () {
test '' = "$2" || echo "$2"
if test '' = "$2"
then
rlogm="$rloga"
else
echo "$2"
rlogm="$rloga: $2"
fi
case "$squash" in
t)
echo "Squash commit -- not updating HEAD"
@@ -70,7 +76,7 @@ finish () {
echo "No merge message -- not updating HEAD"
;;
*)
git-update-ref HEAD "$1" "$head" || exit 1
git-update-ref -m "$rlogm" HEAD "$1" "$head" || exit 1
;;
esac
;;
@@ -88,6 +94,7 @@ finish () {
esac
}
rloga=
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -117,6 +124,9 @@ do
die "available strategies are: $all_strategies" ;;
esac
;;
--reflog-action=*)
rloga=`expr "z$1" : 'z-[^=]*=\(.*\)'`
;;
-*) usage ;;
*) break ;;
esac
@@ -131,6 +141,7 @@ shift
# All the rest are remote heads
test "$#" = 0 && usage ;# we need at least one remote head.
test "$rloga" = '' && rloga="merge: $@"
remoteheads=
for remote
@@ -316,7 +327,7 @@ if test '' != "$result_tree"
then
parents=$(git-show-branch --independent "$head" "$@" | sed -e 's/^/-p /')
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree $parents) || exit
finish "$result_commit" "Merge $result_commit, made by $wt_strategy."
finish "$result_commit" "Merge made by $wt_strategy."
dropsave
exit 0
fi

View File

@@ -102,5 +102,6 @@ case "$strategy_args" in
esac
merge_name=$(git-fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
git-merge $no_summary $no_commit $squash $strategy_args \
git-merge "--reflog-action=pull $*" \
$no_summary $no_commit $squash $strategy_args \
"$merge_name" HEAD $merge_head

View File

@@ -112,7 +112,7 @@ for patch_name in $(cat "$QUILT_PATCHES/series" | grep -v '^#'); do
git-apply --index -C1 "$tmp_patch" &&
tree=$(git-write-tree) &&
commit=$((echo "$SUBJECT"; echo; cat "$tmp_msg") | git-commit-tree $tree -p $commit) &&
git-update-ref HEAD $commit || exit 4
git-update-ref -m "quiltimport: $patch_name" HEAD $commit || exit 4
fi
done
rm -rf $tmp_dir || exit 5

View File

@@ -15,6 +15,7 @@ dropheads() {
head=$(git-rev-parse --verify "$1"^0) &&
merge=$(git-rev-parse --verify "$2"^0) &&
merge_name="$2" &&
merge_msg="$3" || usage
#
@@ -43,7 +44,8 @@ case "$common" in
"$head")
echo "Updating from $head to $merge"
git-read-tree -u -m $head $merge || exit 1
git-update-ref HEAD "$merge" "$head"
git-update-ref -m "resolve $merge_name: Fast forward" \
HEAD "$merge" "$head"
git-diff-tree -p $head $merge | git-apply --stat
dropheads
exit 0
@@ -100,6 +102,7 @@ if [ $? -ne 0 ]; then
fi
result_commit=$(echo "$merge_msg" | git-commit-tree $result_tree -p $head -p $merge)
echo "Committed merge $result_commit"
git-update-ref HEAD "$result_commit" "$head"
git-update-ref -m "resolve $merge_name: In-index merge" \
HEAD "$result_commit" "$head"
git-diff-tree -p $head $result_commit | git-apply --stat
dropheads

View File

@@ -413,7 +413,6 @@ sub send_message
To: $to
Cc: $cc
Subject: $subject
Reply-To: $from
Date: $date
Message-Id: $message_id
X-Mailer: git-send-email $gitversion

View File

@@ -684,7 +684,7 @@ static void *map_sha1_file_internal(const unsigned char *sha1,
return map;
}
int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size)
static int unpack_sha1_header(z_stream *stream, void *map, unsigned long mapsize, void *buffer, unsigned long size)
{
/* Get the data stream */
memset(stream, 0, sizeof(*stream));
@@ -720,7 +720,7 @@ static void *unpack_sha1_rest(z_stream *stream, void *buffer, unsigned long size
* too permissive for what we want to check. So do an anal
* object header parse by hand.
*/
int parse_sha1_header(char *hdr, char *type, unsigned long *sizep)
static int parse_sha1_header(char *hdr, char *type, unsigned long *sizep)
{
int i;
unsigned long size;

View File

@@ -94,7 +94,7 @@ test_expect_success \
test_expect_success \
'merge-setup part 4' \
'echo "evil merge." >>file &&
EDITOR=: VISUAL=: git commit -a --amend'
git commit -a --amend'
test_expect_success \
'Two lines blamed on A, one on B, two on B1, one on B2, one on A U Thor' \

View File

@@ -190,7 +190,6 @@ test_expect_success \
GIT_COMMITTER_DATE="2005-05-26 23:41" git-commit -F M -a &&
h_OTHER=$(git-rev-parse --verify HEAD) &&
echo FIXED >F &&
EDITOR=true \
GIT_AUTHOR_DATE="2005-05-26 23:44" \
GIT_COMMITTER_DATE="2005-05-26 23:44" git-commit --amend &&
h_FIXED=$(git-rev-parse --verify HEAD) &&

View File

@@ -70,7 +70,7 @@ test_expect_success setup '
for i in 1 2; do echo $i; done >>dir/sub &&
git update-index file0 dir/sub &&
EDITOR=: VISUAL=: git commit --amend &&
git commit --amend &&
git show-branch
'

View File

@@ -9,6 +9,8 @@ LC_ALL=C
PAGER=cat
TZ=UTC
export LANG LC_ALL PAGER TZ
EDITOR=:
VISUAL=:
unset AUTHOR_DATE
unset AUTHOR_EMAIL
unset AUTHOR_NAME
@@ -30,6 +32,7 @@ unset SHA1_FILE_DIRECTORIES
unset SHA1_FILE_DIRECTORY
export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
export EDITOR VISUAL
# Each test should start with something like this, after copyright notices:
#