Revert "Make Octopus merge message a bit nicer."
This reverts 63f1aa6c72c46928f1b6959437aed4becbc42ff3 commit.
Junio C Hamano committed
Sep 21, 2005 at 13:59 UTC
b91fb518cc5c5f316ba149ceedff5ee194f44ebf
2 files changed
+11
-86
git-fetch.sh
+6
-10
@@ -58,25 +58,21 @@ append_fetch_head () {
58
# remote-nick is the URL given on the command line (or a shorthand)
59
# remote-name is the $GIT_DIR relative refs/ path we computed
60
# for this refspec.
61
- remote_1_=$(expr "$remote_" : '\(.*\)\.git/*$') &&
62
- remote_="$remote_1_"
63
- case "$remote_" in
64
- . | ./) where_= ;;
65
- *) where_=" of $remote_" ;;
66
- esac
61
case "$remote_name_" in
62
HEAD)
63
note_= ;;
64
refs/heads/*)
65
note_="$(expr "$remote_name_" : 'refs/heads/\(.*\)')"
72
- note_="branch '$note_'" ;;
66
+ note_="branch '$note_' of " ;;
67
refs/tags/*)
68
note_="$(expr "$remote_name_" : 'refs/tags/\(.*\)')"
75
- note_="tag '$note_'" ;;
69
+ note_="tag '$note_' of " ;;
70
*)
77
- note_="$remote_name" ;;
71
+ note_="$remote_name of " ;;
72
esac
79
- note_="$note_$where_"
73
+ remote_1_=$(expr "$remote_" : '\(.*\)\.git/*$') &&
74
+ remote_="$remote_1_"
75
+ note_="$note_$remote_"
76
77
# 2.6.11-tree tag would not be happy to be fed to resolve.
78
if git-cat-file commit "$head_" >/dev/null 2>&1
git-pull.sh
+5
-76
@@ -57,81 +57,10 @@ then
57
fi
58
59
merge_head=$(sed -e 's/ .*//' "$GIT_DIR"/FETCH_HEAD | tr '\012' ' ')
60
-
61
-case "$merge_head" in
62
-?*' '?*)
63
- merge_name="Octopus merge of "$(
64
- perl -e '
65
- my @src;
66
- my %src;
67
-
68
- sub andjoin {
69
- my ($label, $labels, $stuff, $src) = @_;
70
- my $l = scalar @$stuff;
71
- my $m = "";
72
- if ($l == 0) {
73
- return "";
74
- }
75
- if ($l == 1) {
76
- $m = "$label $stuff->[0]";
77
- }
78
- else {
79
- $m = ("$labels " .
80
- join (", ", @{$stuff}[0..$l-2]) .
81
- " and $stuff->[-1]");
82
- }
83
- if ($src ne ".") {
84
- $m .= " from $src";
85
- }
86
- return $m;
87
- }
88
-
89
- while (<>) {
90
- my ($bname, $tname, $gname, $src);
91
- s/^[0-9a-f]* //;
92
- if (s/ of (.*)$//) {
93
- $src = $1;
94
- } else {
95
- $src = ".";
96
- }
97
- if (! exists $src{$src}) {
98
- push @src, $src;
99
- $src{$src} = { BRANCH => [], TAG => [], GENERIC => [] };
100
- }
101
- if (/^branch (.*)$/) {
102
- push @{$src{$src}{BRANCH}}, $1;
103
- }
104
- elsif (/^tag (.*)$/) {
105
- push @{$src{$src}{TAG}}, $1;
106
- }
107
- else {
108
- push @{$src{$src}{GENERIC}}, $1;
109
- }
110
- }
111
- my @msg;
112
- for my $src (@src) {
113
- my $bag = $src{$src}{BRANCH};
114
- if (@{$bag}) {
115
- push @msg, andjoin("branch", "branches", $bag, $src);
116
- }
117
- $bag = $src{$src}{TAG};
118
- if (@{$bag}) {
119
- push @msg, andjoin("tag", "tags", $bag, $src);
120
- }
121
- $bag = $src{$src}{GENERIC};
122
- if (@{$bag}) {
123
- push @msg, andjoin("commit", "commits", $bag, $src);
124
- }
125
- }
126
- print join("; ", @msg);
127
- ' "$GIT_DIR"/FETCH_HEAD
128
- )
129
- ;;
130
-*)
131
- merge_name="Merge "$(sed -e 's/^[0-9a-f]* //' \
132
- "$GIT_DIR"/FETCH_HEAD)
133
- ;;
134
-esac
60
+merge_name=$(
61
+ perl -e 'print join("; ", map { chomp; s/^[0-9a-f]* //; $_ } <>)' \
62
+ "$GIT_DIR"/FETCH_HEAD
63
+)
64
65
case "$merge_head" in
66
'')
@@ -140,4 +69,4 @@ case "$merge_head" in
69
;;
70
esac
71
143
-git-merge $no_summary $strategy_args "$merge_name" HEAD $merge_head
72
+git-merge $no_summary $strategy_args "Merge $merge_name" HEAD $merge_head