Skip to content

Commit bd45e1c

Browse files
committed
Meta: prepare to use alternate name for the primary branch
1 parent 2be3712 commit bd45e1c

File tree

10 files changed

+55
-36
lines changed

10 files changed

+55
-36
lines changed

Announce

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22
# Announcement message skelton
33
#
4+
MASTER=master
5+
46
tmpbase=/var/tmp/git-announce.$$
57
trap 'rm -f $tmpbase.*' 0
68
branch=${1?branch}
@@ -17,7 +19,7 @@ maint)
1719
kind="The latest maintenance release" ;;
1820
mainto/* | maint-[0-9]*)
1921
kind="A maintenance release" ;;
20-
master)
22+
$MASTER)
2123
kind="The latest feature release" ;;
2224
esac
2325

@@ -62,7 +64,7 @@ EOF
6264

6365
(
6466
echo "$kind Git $relname is now available$for_testing at the usual places."
65-
if test "$branch" = master
67+
if test "$branch" = $MASTER
6668
then
6769
cat <<-EOF
6870
It is comprised of $cnt non-merge commits since $previous,
@@ -111,7 +113,7 @@ fmt_people () {
111113

112114
}
113115

114-
if test "$branch" = master
116+
if test "$branch" = $MASTER
115117
then
116118
cat <<-EOF
117119

CheckPush

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
MASTER=master
4+
35
for range in $(
46
prev_branch=
57
{
@@ -33,7 +35,7 @@ for range in $(
3335
'
3436
cat <<-EOF
3537
maint
36-
master
38+
$MASTER
3739
next
3840
EOF
3941
} |
@@ -59,7 +61,7 @@ if ! next_equiv=$(git rev-parse --verify 'jch^{/^### match next}' 2>/dev/null) |
5961
! git diff --stat --exit-code next $next_equiv
6062
then
6163
next_tree=$(git rev-parse next^{tree}) &&
62-
next_equiv=$(git rev-list --first-parent master..seen |
64+
next_equiv=$(git rev-list --first-parent $MASTER..seen |
6365
xargs -n1 sh -c '
6466
echo $(git rev-parse $1^{tree}) $1
6567
' - | sed -n -e "s/^$next_tree //p"
@@ -68,13 +70,13 @@ fi
6870

6971
if test -n "$next_equiv"
7072
then
71-
jch=$(git rev-list --first-parent master..jch | wc -l) &&
72-
seen=$(git rev-list --first-parent master..seen | wc -l) &&
73-
next=$(git rev-list --first-parent master..$next_equiv | wc -l) &&
73+
jch=$(git rev-list --first-parent $MASTER..jch | wc -l) &&
74+
seen=$(git rev-list --first-parent $MASTER..seen | wc -l) &&
75+
next=$(git rev-list --first-parent $MASTER..$next_equiv | wc -l) &&
7476
if test $jch -le $next
7577
then
76-
echo "master..$jch..jch..$next..next..$seen..seen"
78+
echo "$MASTER..$jch..jch..$next..next..$seen..seen"
7779
else
78-
echo "master..$next..next..$jch..jch..$seen..seen"
80+
echo "$MASTER..$next..next..$jch..jch..$seen..seen"
7981
fi
8082
fi

Doit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/sh
22

3-
test -n "$branches" || branches='next master maint jch seen'
3+
MASTER=master
4+
5+
test -n "$branches" || branches="next $MASTER maint jch seen"
46

57
changed=
68
for b in $branches

Dothem

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22

33
NWD=contrib/workdir/git-new-workdir
4+
MASTER=master
45

56
inst_prefix=$(
67
IFS=:
@@ -65,7 +66,7 @@ then
6566
exit 1
6667
fi
6768
fi
68-
test -n "$branches" || branches='next master maint jch seen'
69+
test -n "$branches" || branches="next $MASTER maint jch seen"
6970
test -n "$jobs" || jobs=-j2
7071

7172
find_installed () {

KO

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Not for general consumption; a script I used to make sure
44
# I do not accidentally push a rewound master to public.
55

6+
MASTER=master
7+
68
no_fetch= ko=ko
79
while :
810
do
@@ -19,14 +21,14 @@ then
1921
git fetch "$ko"
2022
fi
2123

22-
mb=$(git merge-base $ko/master master)
23-
h=$(git rev-parse $mb $ko/master | sort -u | wc -l)
24+
mb=$(git merge-base $ko/$MASTER $MASTER)
25+
h=$(git rev-parse $mb $ko/$MASTER | sort -u | wc -l)
2426
if test "$h" != 1
2527
then
26-
echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward."
28+
echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
2729
exit 1
2830
fi
29-
git show-branch --topo-order $ko/master master
31+
git show-branch --topo-order $ko/$MASTER $MASTER
3032
git show-branch --topo-order $ko/maint maint
3133
git show-branch --topo-order $ko/next next
3234
git show-branch --topo-order $ko/seen seen

ML

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/bin/sh
22
# Merge later...
33

4-
: "${target:=maint}" "${here:=master}"
4+
MASTER=master
5+
6+
: "${target:=maint}" "${here:=$MASTER}"
57

68
# Read from RelNotes and find mergeable topics
79
search_topics () {

Make

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
MASTER=master
4+
35
if test -z "$GIT"
46
then
57
case "$(git version 2>/dev/null)" in
@@ -215,7 +217,7 @@ export LANG LC_ALL
215217
branch=$(determine_branch)
216218

217219
case "$branch" in
218-
next | maint | master | seen | jch)
220+
next | maint | $MASTER | seen | jch)
219221
prefix="$inst_prefix/git-$branch"
220222
;;
221223
snap)

WCBCC

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/sh
22

3+
MASTER=master
34
BASE=${1-HEAD}
45

56
(
@@ -12,7 +13,7 @@ BASE=${1-HEAD}
1213
echo "$branch"
1314
done
1415
git -C Meta/ cat-file blob "${BASE}:whats-cooking.txt" |
15-
sed -ne 's/^X-master-at: / --not /p' -e '/^$/q'
16+
sed -ne "s/^X-$MASTER-at: / --not /p" -e '/^$/q'
1617
) |
1718
xargs git shortlog -s -e --no-merges |
1819
sed -e 's/.*</ </' -e '$q' -e 's/$/,/'

amlook

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Meta/amlook id1 id2... (from the command line)
55
# Meta/amlook --gc
66

7+
MASTER=master
8+
79
find_commit () {
810
in= commits=
911

@@ -43,7 +45,7 @@ find_commit () {
4345
fi
4446
case " $found " in
4547
*' maint '*) in=maint ;;
46-
*' master '*) in=master ;;
48+
*" $MASTER "*) in=$MASTER ;;
4749
*' next '*) in=next ;;
4850
esac
4951
if test -n "$in"

cook

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/perl -w
22
# Maintain "what's cooking" messages
33

4+
my $MASTER = 'master'; # for now
5+
46
use strict;
57

68
my %reverts = ('next' => {
@@ -66,7 +68,7 @@ sub topic_relation {
6668
my $fh;
6769
open($fh, '-|',
6870
qw(git log --abbrev), "--format=%m %h",
69-
"$one...$two", "^master")
71+
"$one...$two", "^$MASTER")
7072
or die "$!: open log --left-right";
7173
my (@left, @right);
7274
while (<$fh>) {
@@ -107,7 +109,7 @@ Returns a hash:
107109
=cut
108110

109111
sub get_commit {
110-
my (@base) = qw(master next seen);
112+
my (@base) = ($MASTER, 'next', 'seen');
111113
my $fh;
112114
open($fh, '-|',
113115
qw(git for-each-ref),
@@ -206,8 +208,8 @@ sub get_commit {
206208

207209
open($fh, '-|',
208210
qw(git log --first-parent --abbrev),
209-
"--format=%ci %h %p :%s", "master..next")
210-
or die "$!: open log master..next";
211+
"--format=%ci %h %p :%s", "$MASTER..next")
212+
or die "$!: open log $MASTER..next";
211213
while (<$fh>) {
212214
my ($date, $commit, $parent, $tips);
213215
unless (($date, $commit, $parent, $tips) =
@@ -220,7 +222,7 @@ sub get_commit {
220222
$co->{'merged'} = " (merged to 'next' on $date at $commit)";
221223
}
222224
}
223-
close($fh) or die "$!: close log master..next";
225+
close($fh) or die "$!: close log $MASTER..next";
224226

225227
for my $branch (keys %topic) {
226228
my @log = ();
@@ -300,7 +302,7 @@ EOF
300302
To: git\@vger.kernel.org
301303
Bcc: lwn\@lwn.net
302304
Subject: What's cooking in git.git ($mon $year, #$issue; $dow, $date)
303-
X-master-at: $master_at
305+
X-$MASTER-at: $master_at
304306
X-next-at: $next_at
305307
306308
What's cooking in git.git ($mon $year, #$issue; $dow, $date)
@@ -314,7 +316,7 @@ EOF
314316

315317
my $blurb_match = <<'EOF';
316318
(?:(?i:\s*[a-z]+: .*|\s.*)\n)*?Subject: What's cooking in \S+ \((\w+) (\d+), #(\d+); (\w+), (\d+)\)
317-
X-master-at: ([0-9a-f]{40})
319+
X-[a-z]*-at: ([0-9a-f]{40})
318320
X-next-at: ([0-9a-f]{40})
319321
320322
What's cooking in \S+ \(\1 \2, #\3; \4, \5\)
@@ -476,7 +478,7 @@ sub write_cooking {
476478
close($fh);
477479
}
478480

479-
my $graduated = 'Graduated to "master"';
481+
my $graduated = "Graduated to '$MASTER'";
480482
my $new_topics = 'New Topics';
481483
my $discarded = 'Discarded';
482484
my $cooking_topics = 'Cooking';
@@ -488,11 +490,11 @@ sub update_issue {
488490
open($fh, '-|',
489491
qw(git for-each-ref),
490492
"--format=%(refname:short) %(objectname)",
491-
"refs/heads/master",
493+
"refs/heads/$MASTER",
492494
"refs/heads/next") or die "$!: open for-each-ref";
493495
while (<$fh>) {
494496
my ($branch, $at) = /^(\S+) (\S+)$/;
495-
if ($branch eq 'master') { $master_at = $at; }
497+
if ($branch eq $MASTER) { $master_at = $at; }
496498
if ($branch eq 'next') { $next_at = $at; }
497499
}
498500
close($fh) or die "$!: close for-each-ref";
@@ -564,11 +566,11 @@ sub tweak_willdo {
564566
my $text = $td->{'text'};
565567

566568
if (!defined $mergetomaster) {
567-
my $master = `git describe master`;
569+
my $master = `git describe $MASTER`;
568570
if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
569571
$mergetomaster = "Will cook in 'next'.";
570572
} else {
571-
$mergetomaster = "Will merge to 'master'.";
573+
$mergetomaster = "Will merge to '$MASTER'.";
572574
}
573575
}
574576

@@ -580,7 +582,7 @@ sub tweak_willdo {
580582
if ($desc =~ /^ \(merged to 'next'/m) {
581583
$text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
582584
$text =~ s/^ Will merge to and (then )?cook in 'next'\.$/ Will cook in 'next'./m;
583-
$text =~ s/^ Will merge to 'next' and (then )?to 'master'\.$/ Will merge to 'master'./m;
585+
$text =~ s/^ Will merge to 'next' and (then )?to '$MASTER'\.$/ Will merge to '$MASTER'./m;
584586
}
585587
$td->{'text'} = $text;
586588
}
@@ -590,7 +592,7 @@ sub tweak_graduated {
590592

591593
# Remove the "Will merge" marker from topics that have graduated.
592594
for ($td->{'text'}) {
593-
s/\n Will merge to 'master'\.(\n|$)//s;
595+
s/\n Will merge to '$MASTER'\.(\n|$)//s;
594596
}
595597
}
596598

@@ -825,12 +827,13 @@ sub havedone {
825827
my ($topic, $to_maint, %to_maint, %merged, $in_desc);
826828
if (!@ARGV) {
827829
open($fh, '-|',
828-
qw(git rev-list --first-parent -1 master Documentation/RelNotes RelNotes))
830+
qw(git rev-list --first-parent -1), $MASTER,
831+
qw(-- Documentation/RelNotes RelNotes))
829832
or die "$!: open rev-list";
830833
my ($rev) = <$fh>;
831834
close($fh) or die "$!: close rev-list";
832835
chomp $rev;
833-
@ARGV = ("$rev..master");
836+
@ARGV = ("$rev..$MASTER");
834837
}
835838
open($fh, '-|',
836839
qw(git log --first-parent --oneline --reverse), @ARGV)

0 commit comments

Comments
 (0)