Meta: prepare to use alternate name for the primary branch
Junio C Hamano committed
Jul 22, 2020 at 21:35 UTC
bd45e1c3024e03459c8239a9026d7119ddd47925
10 files changed
+55
-36
Announce
+5
-3
index 91d0ba44cc..491516b61a 100755
--- a/Announce
+++ b/Announce
@@ -1,6 +1,8 @@
#!/bin/sh
# Announcement message skelton
#
+MASTER=master
+
tmpbase=/var/tmp/git-announce.$$
trap 'rm -f $tmpbase.*' 0
branch=${1?branch}
@@ -17,7 +19,7 @@ maint)
kind="The latest maintenance release" ;;
mainto/* | maint-[0-9]*)
kind="A maintenance release" ;;
-master)
+$MASTER)
kind="The latest feature release" ;;
esac
@@ -62,7 +64,7 @@ EOF
(
echo "$kind Git $relname is now available$for_testing at the usual places."
- if test "$branch" = master
+ if test "$branch" = $MASTER
then
cat <<-EOF
It is comprised of $cnt non-merge commits since $previous,
@@ -111,7 +113,7 @@ fmt_people () {
}
-if test "$branch" = master
+if test "$branch" = $MASTER
then
cat <<-EOF
CheckPush
+9
-7
index fb0ecd4d68..07decedfc3 100755
--- a/CheckPush
+++ b/CheckPush
@@ -1,5 +1,7 @@
#!/bin/sh
+MASTER=master
+
for range in $(
prev_branch=
{
@@ -33,7 +35,7 @@ for range in $(
'
cat <<-EOF
maint
- master
+ $MASTER
next
EOF
} |
@@ -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
then
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 '
echo $(git rev-parse $1^{tree}) $1
' - | sed -n -e "s/^$next_tree //p"
@@ -68,13 +70,13 @@ fi
if test -n "$next_equiv"
then
- jch=$(git rev-list --first-parent master..jch | wc -l) &&
- seen=$(git rev-list --first-parent master..seen | wc -l) &&
- next=$(git rev-list --first-parent master..$next_equiv | wc -l) &&
+ jch=$(git rev-list --first-parent $MASTER..jch | wc -l) &&
+ seen=$(git rev-list --first-parent $MASTER..seen | wc -l) &&
+ next=$(git rev-list --first-parent $MASTER..$next_equiv | wc -l) &&
if test $jch -le $next
then
- echo "master..$jch..jch..$next..next..$seen..seen"
+ echo "$MASTER..$jch..jch..$next..next..$seen..seen"
else
- echo "master..$next..next..$jch..jch..$seen..seen"
+ echo "$MASTER..$next..next..$jch..jch..$seen..seen"
fi
fi
Doit
+3
-1
index f4989d43d5..38fdeeccf0 100755
--- a/Doit
+++ b/Doit
@@ -1,6 +1,8 @@
#!/bin/sh
-test -n "$branches" || branches='next master maint jch seen'
+MASTER=master
+
+test -n "$branches" || branches="next $MASTER maint jch seen"
changed=
for b in $branches
Dothem
+2
-1
index f9d96ee339..8b424e8b89 100755
--- a/Dothem
+++ b/Dothem
@@ -1,6 +1,7 @@
#!/bin/sh
NWD=contrib/workdir/git-new-workdir
+MASTER=master
inst_prefix=$(
IFS=:
@@ -65,7 +66,7 @@ then
exit 1
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
find_installed () {
KO
+6
-4
index e4bcd7e1c0..6e8f05e9d3 100755
--- a/KO
+++ b/KO
@@ -3,6 +3,8 @@
# Not for general consumption; a script I used to make sure
# I do not accidentally push a rewound master to public.
+MASTER=master
+
no_fetch= ko=ko
while :
do
@@ -19,14 +21,14 @@ then
git fetch "$ko"
fi
-mb=$(git merge-base $ko/master master)
-h=$(git rev-parse $mb $ko/master | sort -u | wc -l)
+mb=$(git merge-base $ko/$MASTER $MASTER)
+h=$(git rev-parse $mb $ko/$MASTER | sort -u | wc -l)
if test "$h" != 1
then
- echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward."
+ echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
exit 1
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/next next
git show-branch --topo-order $ko/seen seen
ML
+3
-1
index 7a74151b62..6d2b52fc42 100755
--- a/ML
+++ b/ML
@@ -1,7 +1,9 @@
#!/bin/sh
# Merge later...
-: "${target:=maint}" "${here:=master}"
+MASTER=master
+
+: "${target:=maint}" "${here:=$MASTER}"
# Read from RelNotes and find mergeable topics
search_topics () {
Make
+3
-1
index 675da1b628..ceceb52896 100755
--- a/Make
+++ b/Make
@@ -1,5 +1,7 @@
#!/bin/sh
+MASTER=master
+
if test -z "$GIT"
then
case "$(git version 2>/dev/null)" in
@@ -215,7 +217,7 @@ export LANG LC_ALL
branch=$(determine_branch)
case "$branch" in
-next | maint | master | seen | jch)
+next | maint | $MASTER | seen | jch)
prefix="$inst_prefix/git-$branch"
;;
snap)
WCBCC
+2
-1
index 636390a9fb..fdded8075d 100755
--- a/WCBCC
+++ b/WCBCC
@@ -1,5 +1,6 @@
#!/bin/sh
+MASTER=master
BASE=${1-HEAD}
(
@@ -12,7 +13,7 @@ BASE=${1-HEAD}
echo "$branch"
done
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 |
sed -e 's/.*</ </' -e '$q' -e 's/$/,/'
amlook
+3
-1
index 9ab8354f93..dcae1f0407 100755
--- a/amlook
+++ b/amlook
@@ -4,6 +4,8 @@
# Meta/amlook id1 id2... (from the command line)
# Meta/amlook --gc
+MASTER=master
+
find_commit () {
in= commits=
@@ -43,7 +45,7 @@ find_commit () {
fi
case " $found " in
*' maint '*) in=maint ;;
- *' master '*) in=master ;;
+ *" $MASTER "*) in=$MASTER ;;
*' next '*) in=next ;;
esac
if test -n "$in"
cook
+19
-16
index e814304be5..f357d05421 100755
--- a/cook
+++ b/cook
@@ -1,6 +1,8 @@
#!/usr/bin/perl -w
# Maintain "what's cooking" messages
+my $MASTER = 'master'; # for now
+
use strict;
my %reverts = ('next' => {
@@ -66,7 +68,7 @@ sub topic_relation {
my $fh;
open($fh, '-|',
qw(git log --abbrev), "--format=%m %h",
- "$one...$two", "^master")
+ "$one...$two", "^$MASTER")
or die "$!: open log --left-right";
my (@left, @right);
while (<$fh>) {
@@ -107,7 +109,7 @@ Returns a hash:
=cut
sub get_commit {
- my (@base) = qw(master next seen);
+ my (@base) = ($MASTER, 'next', 'seen');
my $fh;
open($fh, '-|',
qw(git for-each-ref),
@@ -206,8 +208,8 @@ sub get_commit {
open($fh, '-|',
qw(git log --first-parent --abbrev),
- "--format=%ci %h %p :%s", "master..next")
- or die "$!: open log master..next";
+ "--format=%ci %h %p :%s", "$MASTER..next")
+ or die "$!: open log $MASTER..next";
while (<$fh>) {
my ($date, $commit, $parent, $tips);
unless (($date, $commit, $parent, $tips) =
@@ -220,7 +222,7 @@ sub get_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) {
my @log = ();
@@ -300,7 +302,7 @@ EOF
To: git\@vger.kernel.org
Bcc: lwn\@lwn.net
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
What's cooking in git.git ($mon $year, #$issue; $dow, $date)
@@ -314,7 +316,7 @@ EOF
my $blurb_match = <<'EOF';
(?:(?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})
What's cooking in \S+ \(\1 \2, #\3; \4, \5\)
@@ -476,7 +478,7 @@ sub write_cooking {
close($fh);
}
-my $graduated = 'Graduated to "master"';
+my $graduated = "Graduated to '$MASTER'";
my $new_topics = 'New Topics';
my $discarded = 'Discarded';
my $cooking_topics = 'Cooking';
@@ -488,11 +490,11 @@ sub update_issue {
open($fh, '-|',
qw(git for-each-ref),
"--format=%(refname:short) %(objectname)",
- "refs/heads/master",
+ "refs/heads/$MASTER",
"refs/heads/next") or die "$!: open for-each-ref";
while (<$fh>) {
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; }
}
close($fh) or die "$!: close for-each-ref";
@@ -564,11 +566,11 @@ sub tweak_willdo {
my $text = $td->{'text'};
if (!defined $mergetomaster) {
- my $master = `git describe master`;
+ my $master = `git describe $MASTER`;
if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
$mergetomaster = "Will cook in 'next'.";
} else {
- $mergetomaster = "Will merge to 'master'.";
+ $mergetomaster = "Will merge to '$MASTER'.";
}
}
@@ -580,7 +582,7 @@ sub tweak_willdo {
if ($desc =~ /^ \(merged to 'next'/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 '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;
}
@@ -590,7 +592,7 @@ sub tweak_graduated {
# Remove the "Will merge" marker from topics that have graduated.
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 {
my ($topic, $to_maint, %to_maint, %merged, $in_desc);
if (!@ARGV) {
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";
my ($rev) = <$fh>;
close($fh) or die "$!: close rev-list";
chomp $rev;
- @ARGV = ("$rev..master");
+ @ARGV = ("$rev..$MASTER");
}
open($fh, '-|',
qw(git log --first-parent --oneline --reverse), @ARGV)