提交 bd45e1c3 编写于 作者: J Junio C Hamano

Meta: prepare to use alternate name for the primary branch

上级 2be3712f
#!/bin/sh #!/bin/sh
# Announcement message skelton # Announcement message skelton
# #
MASTER=master
tmpbase=/var/tmp/git-announce.$$ tmpbase=/var/tmp/git-announce.$$
trap 'rm -f $tmpbase.*' 0 trap 'rm -f $tmpbase.*' 0
branch=${1?branch} branch=${1?branch}
...@@ -17,7 +19,7 @@ maint) ...@@ -17,7 +19,7 @@ maint)
kind="The latest maintenance release" ;; kind="The latest maintenance release" ;;
mainto/* | maint-[0-9]*) mainto/* | maint-[0-9]*)
kind="A maintenance release" ;; kind="A maintenance release" ;;
master) $MASTER)
kind="The latest feature release" ;; kind="The latest feature release" ;;
esac esac
...@@ -62,7 +64,7 @@ EOF ...@@ -62,7 +64,7 @@ EOF
( (
echo "$kind Git $relname is now available$for_testing at the usual places." echo "$kind Git $relname is now available$for_testing at the usual places."
if test "$branch" = master if test "$branch" = $MASTER
then then
cat <<-EOF cat <<-EOF
It is comprised of $cnt non-merge commits since $previous, It is comprised of $cnt non-merge commits since $previous,
...@@ -111,7 +113,7 @@ fmt_people () { ...@@ -111,7 +113,7 @@ fmt_people () {
} }
if test "$branch" = master if test "$branch" = $MASTER
then then
cat <<-EOF cat <<-EOF
......
#!/bin/sh #!/bin/sh
MASTER=master
for range in $( for range in $(
prev_branch= prev_branch=
{ {
...@@ -33,7 +35,7 @@ for range in $( ...@@ -33,7 +35,7 @@ for range in $(
' '
cat <<-EOF cat <<-EOF
maint maint
master $MASTER
next next
EOF EOF
} | } |
...@@ -59,7 +61,7 @@ if ! next_equiv=$(git rev-parse --verify 'jch^{/^### match next}' 2>/dev/null) | ...@@ -59,7 +61,7 @@ if ! next_equiv=$(git rev-parse --verify 'jch^{/^### match next}' 2>/dev/null) |
! git diff --stat --exit-code next $next_equiv ! git diff --stat --exit-code next $next_equiv
then then
next_tree=$(git rev-parse next^{tree}) && next_tree=$(git rev-parse next^{tree}) &&
next_equiv=$(git rev-list --first-parent master..seen | next_equiv=$(git rev-list --first-parent $MASTER..seen |
xargs -n1 sh -c ' xargs -n1 sh -c '
echo $(git rev-parse $1^{tree}) $1 echo $(git rev-parse $1^{tree}) $1
' - | sed -n -e "s/^$next_tree //p" ' - | sed -n -e "s/^$next_tree //p"
...@@ -68,13 +70,13 @@ fi ...@@ -68,13 +70,13 @@ fi
if test -n "$next_equiv" if test -n "$next_equiv"
then then
jch=$(git rev-list --first-parent master..jch | wc -l) && jch=$(git rev-list --first-parent $MASTER..jch | wc -l) &&
seen=$(git rev-list --first-parent master..seen | wc -l) && seen=$(git rev-list --first-parent $MASTER..seen | wc -l) &&
next=$(git rev-list --first-parent master..$next_equiv | wc -l) && next=$(git rev-list --first-parent $MASTER..$next_equiv | wc -l) &&
if test $jch -le $next if test $jch -le $next
then then
echo "master..$jch..jch..$next..next..$seen..seen" echo "$MASTER..$jch..jch..$next..next..$seen..seen"
else else
echo "master..$next..next..$jch..jch..$seen..seen" echo "$MASTER..$next..next..$jch..jch..$seen..seen"
fi fi
fi fi
#!/bin/sh #!/bin/sh
test -n "$branches" || branches='next master maint jch seen' MASTER=master
test -n "$branches" || branches="next $MASTER maint jch seen"
changed= changed=
for b in $branches for b in $branches
......
#!/bin/sh #!/bin/sh
NWD=contrib/workdir/git-new-workdir NWD=contrib/workdir/git-new-workdir
MASTER=master
inst_prefix=$( inst_prefix=$(
IFS=: IFS=:
...@@ -65,7 +66,7 @@ then ...@@ -65,7 +66,7 @@ then
exit 1 exit 1
fi fi
fi fi
test -n "$branches" || branches='next master maint jch seen' test -n "$branches" || branches="next $MASTER maint jch seen"
test -n "$jobs" || jobs=-j2 test -n "$jobs" || jobs=-j2
find_installed () { find_installed () {
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
# Not for general consumption; a script I used to make sure # Not for general consumption; a script I used to make sure
# I do not accidentally push a rewound master to public. # I do not accidentally push a rewound master to public.
MASTER=master
no_fetch= ko=ko no_fetch= ko=ko
while : while :
do do
...@@ -19,14 +21,14 @@ then ...@@ -19,14 +21,14 @@ then
git fetch "$ko" git fetch "$ko"
fi fi
mb=$(git merge-base $ko/master master) mb=$(git merge-base $ko/$MASTER $MASTER)
h=$(git rev-parse $mb $ko/master | sort -u | wc -l) h=$(git rev-parse $mb $ko/$MASTER | sort -u | wc -l)
if test "$h" != 1 if test "$h" != 1
then then
echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward." echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
exit 1 exit 1
fi fi
git show-branch --topo-order $ko/master master git show-branch --topo-order $ko/$MASTER $MASTER
git show-branch --topo-order $ko/maint maint git show-branch --topo-order $ko/maint maint
git show-branch --topo-order $ko/next next git show-branch --topo-order $ko/next next
git show-branch --topo-order $ko/seen seen git show-branch --topo-order $ko/seen seen
#!/bin/sh #!/bin/sh
# Merge later... # Merge later...
: "${target:=maint}" "${here:=master}" MASTER=master
: "${target:=maint}" "${here:=$MASTER}"
# Read from RelNotes and find mergeable topics # Read from RelNotes and find mergeable topics
search_topics () { search_topics () {
......
#!/bin/sh #!/bin/sh
MASTER=master
if test -z "$GIT" if test -z "$GIT"
then then
case "$(git version 2>/dev/null)" in case "$(git version 2>/dev/null)" in
...@@ -215,7 +217,7 @@ export LANG LC_ALL ...@@ -215,7 +217,7 @@ export LANG LC_ALL
branch=$(determine_branch) branch=$(determine_branch)
case "$branch" in case "$branch" in
next | maint | master | seen | jch) next | maint | $MASTER | seen | jch)
prefix="$inst_prefix/git-$branch" prefix="$inst_prefix/git-$branch"
;; ;;
snap) snap)
......
#!/bin/sh #!/bin/sh
MASTER=master
BASE=${1-HEAD} BASE=${1-HEAD}
( (
...@@ -12,7 +13,7 @@ BASE=${1-HEAD} ...@@ -12,7 +13,7 @@ BASE=${1-HEAD}
echo "$branch" echo "$branch"
done done
git -C Meta/ cat-file blob "${BASE}:whats-cooking.txt" | git -C Meta/ cat-file blob "${BASE}:whats-cooking.txt" |
sed -ne 's/^X-master-at: / --not /p' -e '/^$/q' sed -ne "s/^X-$MASTER-at: / --not /p" -e '/^$/q'
) | ) |
xargs git shortlog -s -e --no-merges | xargs git shortlog -s -e --no-merges |
sed -e 's/.*</ </' -e '$q' -e 's/$/,/' sed -e 's/.*</ </' -e '$q' -e 's/$/,/'
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
# Meta/amlook id1 id2... (from the command line) # Meta/amlook id1 id2... (from the command line)
# Meta/amlook --gc # Meta/amlook --gc
MASTER=master
find_commit () { find_commit () {
in= commits= in= commits=
...@@ -43,7 +45,7 @@ find_commit () { ...@@ -43,7 +45,7 @@ find_commit () {
fi fi
case " $found " in case " $found " in
*' maint '*) in=maint ;; *' maint '*) in=maint ;;
*' master '*) in=master ;; *" $MASTER "*) in=$MASTER ;;
*' next '*) in=next ;; *' next '*) in=next ;;
esac esac
if test -n "$in" if test -n "$in"
......
#!/usr/bin/perl -w #!/usr/bin/perl -w
# Maintain "what's cooking" messages # Maintain "what's cooking" messages
my $MASTER = 'master'; # for now
use strict; use strict;
my %reverts = ('next' => { my %reverts = ('next' => {
...@@ -66,7 +68,7 @@ sub topic_relation { ...@@ -66,7 +68,7 @@ sub topic_relation {
my $fh; my $fh;
open($fh, '-|', open($fh, '-|',
qw(git log --abbrev), "--format=%m %h", qw(git log --abbrev), "--format=%m %h",
"$one...$two", "^master") "$one...$two", "^$MASTER")
or die "$!: open log --left-right"; or die "$!: open log --left-right";
my (@left, @right); my (@left, @right);
while (<$fh>) { while (<$fh>) {
...@@ -107,7 +109,7 @@ Returns a hash: ...@@ -107,7 +109,7 @@ Returns a hash:
=cut =cut
sub get_commit { sub get_commit {
my (@base) = qw(master next seen); my (@base) = ($MASTER, 'next', 'seen');
my $fh; my $fh;
open($fh, '-|', open($fh, '-|',
qw(git for-each-ref), qw(git for-each-ref),
...@@ -206,8 +208,8 @@ sub get_commit { ...@@ -206,8 +208,8 @@ sub get_commit {
open($fh, '-|', open($fh, '-|',
qw(git log --first-parent --abbrev), qw(git log --first-parent --abbrev),
"--format=%ci %h %p :%s", "master..next") "--format=%ci %h %p :%s", "$MASTER..next")
or die "$!: open log master..next"; or die "$!: open log $MASTER..next";
while (<$fh>) { while (<$fh>) {
my ($date, $commit, $parent, $tips); my ($date, $commit, $parent, $tips);
unless (($date, $commit, $parent, $tips) = unless (($date, $commit, $parent, $tips) =
...@@ -220,7 +222,7 @@ sub get_commit { ...@@ -220,7 +222,7 @@ sub get_commit {
$co->{'merged'} = " (merged to 'next' on $date at $commit)"; $co->{'merged'} = " (merged to 'next' on $date at $commit)";
} }
} }
close($fh) or die "$!: close log master..next"; close($fh) or die "$!: close log $MASTER..next";
for my $branch (keys %topic) { for my $branch (keys %topic) {
my @log = (); my @log = ();
...@@ -300,7 +302,7 @@ EOF ...@@ -300,7 +302,7 @@ EOF
To: git\@vger.kernel.org To: git\@vger.kernel.org
Bcc: lwn\@lwn.net Bcc: lwn\@lwn.net
Subject: What's cooking in git.git ($mon $year, #$issue; $dow, $date) Subject: What's cooking in git.git ($mon $year, #$issue; $dow, $date)
X-master-at: $master_at X-$MASTER-at: $master_at
X-next-at: $next_at X-next-at: $next_at
What's cooking in git.git ($mon $year, #$issue; $dow, $date) What's cooking in git.git ($mon $year, #$issue; $dow, $date)
...@@ -314,7 +316,7 @@ EOF ...@@ -314,7 +316,7 @@ EOF
my $blurb_match = <<'EOF'; my $blurb_match = <<'EOF';
(?:(?i:\s*[a-z]+: .*|\s.*)\n)*?Subject: What's cooking in \S+ \((\w+) (\d+), #(\d+); (\w+), (\d+)\) (?:(?i:\s*[a-z]+: .*|\s.*)\n)*?Subject: What's cooking in \S+ \((\w+) (\d+), #(\d+); (\w+), (\d+)\)
X-master-at: ([0-9a-f]{40}) X-[a-z]*-at: ([0-9a-f]{40})
X-next-at: ([0-9a-f]{40}) X-next-at: ([0-9a-f]{40})
What's cooking in \S+ \(\1 \2, #\3; \4, \5\) What's cooking in \S+ \(\1 \2, #\3; \4, \5\)
...@@ -476,7 +478,7 @@ sub write_cooking { ...@@ -476,7 +478,7 @@ sub write_cooking {
close($fh); close($fh);
} }
my $graduated = 'Graduated to "master"'; my $graduated = "Graduated to '$MASTER'";
my $new_topics = 'New Topics'; my $new_topics = 'New Topics';
my $discarded = 'Discarded'; my $discarded = 'Discarded';
my $cooking_topics = 'Cooking'; my $cooking_topics = 'Cooking';
...@@ -488,11 +490,11 @@ sub update_issue { ...@@ -488,11 +490,11 @@ sub update_issue {
open($fh, '-|', open($fh, '-|',
qw(git for-each-ref), qw(git for-each-ref),
"--format=%(refname:short) %(objectname)", "--format=%(refname:short) %(objectname)",
"refs/heads/master", "refs/heads/$MASTER",
"refs/heads/next") or die "$!: open for-each-ref"; "refs/heads/next") or die "$!: open for-each-ref";
while (<$fh>) { while (<$fh>) {
my ($branch, $at) = /^(\S+) (\S+)$/; my ($branch, $at) = /^(\S+) (\S+)$/;
if ($branch eq 'master') { $master_at = $at; } if ($branch eq $MASTER) { $master_at = $at; }
if ($branch eq 'next') { $next_at = $at; } if ($branch eq 'next') { $next_at = $at; }
} }
close($fh) or die "$!: close for-each-ref"; close($fh) or die "$!: close for-each-ref";
...@@ -564,11 +566,11 @@ sub tweak_willdo { ...@@ -564,11 +566,11 @@ sub tweak_willdo {
my $text = $td->{'text'}; my $text = $td->{'text'};
if (!defined $mergetomaster) { if (!defined $mergetomaster) {
my $master = `git describe master`; my $master = `git describe $MASTER`;
if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) { if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
$mergetomaster = "Will cook in 'next'."; $mergetomaster = "Will cook in 'next'.";
} else { } else {
$mergetomaster = "Will merge to 'master'."; $mergetomaster = "Will merge to '$MASTER'.";
} }
} }
...@@ -580,7 +582,7 @@ sub tweak_willdo { ...@@ -580,7 +582,7 @@ sub tweak_willdo {
if ($desc =~ /^ \(merged to 'next'/m) { if ($desc =~ /^ \(merged to 'next'/m) {
$text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m; $text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
$text =~ s/^ Will merge to and (then )?cook in 'next'\.$/ Will cook in 'next'./m; $text =~ s/^ Will merge to and (then )?cook in 'next'\.$/ Will cook in 'next'./m;
$text =~ s/^ Will merge to 'next' and (then )?to 'master'\.$/ Will merge to 'master'./m; $text =~ s/^ Will merge to 'next' and (then )?to '$MASTER'\.$/ Will merge to '$MASTER'./m;
} }
$td->{'text'} = $text; $td->{'text'} = $text;
} }
...@@ -590,7 +592,7 @@ sub tweak_graduated { ...@@ -590,7 +592,7 @@ sub tweak_graduated {
# Remove the "Will merge" marker from topics that have graduated. # Remove the "Will merge" marker from topics that have graduated.
for ($td->{'text'}) { for ($td->{'text'}) {
s/\n Will merge to 'master'\.(\n|$)//s; s/\n Will merge to '$MASTER'\.(\n|$)//s;
} }
} }
...@@ -825,12 +827,13 @@ sub havedone { ...@@ -825,12 +827,13 @@ sub havedone {
my ($topic, $to_maint, %to_maint, %merged, $in_desc); my ($topic, $to_maint, %to_maint, %merged, $in_desc);
if (!@ARGV) { if (!@ARGV) {
open($fh, '-|', open($fh, '-|',
qw(git rev-list --first-parent -1 master Documentation/RelNotes RelNotes)) qw(git rev-list --first-parent -1), $MASTER,
qw(-- Documentation/RelNotes RelNotes))
or die "$!: open rev-list"; or die "$!: open rev-list";
my ($rev) = <$fh>; my ($rev) = <$fh>;
close($fh) or die "$!: close rev-list"; close($fh) or die "$!: close rev-list";
chomp $rev; chomp $rev;
@ARGV = ("$rev..master"); @ARGV = ("$rev..$MASTER");
} }
open($fh, '-|', open($fh, '-|',
qw(git log --first-parent --oneline --reverse), @ARGV) qw(git log --first-parent --oneline --reverse), @ARGV)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册