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
@@ -1,6 +1,8 @@
1 #!/bin/sh
2 # Announcement message skelton
3 #
4 +MASTER=master
5 +
6 tmpbase=/var/tmp/git-announce.$$
7 trap 'rm -f $tmpbase.*' 0
8 branch=${1?branch}
@@ -17,7 +19,7 @@ maint)
19 kind="The latest maintenance release" ;;
20 mainto/* | maint-[0-9]*)
21 kind="A maintenance release" ;;
20 -master)
22 +$MASTER)
23 kind="The latest feature release" ;;
24 esac
25
@@ -62,7 +64,7 @@ EOF
64
65 (
66 echo "$kind Git $relname is now available$for_testing at the usual places."
65 - if test "$branch" = master
67 + if test "$branch" = $MASTER
68 then
69 cat <<-EOF
70 It is comprised of $cnt non-merge commits since $previous,
@@ -111,7 +113,7 @@ fmt_people () {
113
114 }
115
114 -if test "$branch" = master
116 +if test "$branch" = $MASTER
117 then
118 cat <<-EOF
119
CheckPush
+9 -7
@@ -1,5 +1,7 @@
1 #!/bin/sh
2
3 +MASTER=master
4 +
5 for range in $(
6 prev_branch=
7 {
@@ -33,7 +35,7 @@ for range in $(
35 '
36 cat <<-EOF
37 maint
36 - master
38 + $MASTER
39 next
40 EOF
41 } |
@@ -59,7 +61,7 @@ if ! next_equiv=$(git rev-parse --verify 'jch^{/^### match next}' 2>/dev/null) |
61 ! git diff --stat --exit-code next $next_equiv
62 then
63 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 |
65 xargs -n1 sh -c '
66 echo $(git rev-parse $1^{tree}) $1
67 ' - | sed -n -e "s/^$next_tree //p"
@@ -68,13 +70,13 @@ fi
70
71 if test -n "$next_equiv"
72 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) &&
76 if test $jch -le $next
77 then
76 - echo "master..$jch..jch..$next..next..$seen..seen"
78 + echo "$MASTER..$jch..jch..$next..next..$seen..seen"
79 else
78 - echo "master..$next..next..$jch..jch..$seen..seen"
80 + echo "$MASTER..$next..next..$jch..jch..$seen..seen"
81 fi
82 fi
Doit
+3 -1
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 -test -n "$branches" || branches='next master maint jch seen'
3 +MASTER=master
4 +
5 +test -n "$branches" || branches="next $MASTER maint jch seen"
6
7 changed=
8 for b in $branches
Dothem
+2 -1
@@ -1,6 +1,7 @@
1 #!/bin/sh
2
3 NWD=contrib/workdir/git-new-workdir
4 +MASTER=master
5
6 inst_prefix=$(
7 IFS=:
@@ -65,7 +66,7 @@ then
66 exit 1
67 fi
68 fi
68 -test -n "$branches" || branches='next master maint jch seen'
69 +test -n "$branches" || branches="next $MASTER maint jch seen"
70 test -n "$jobs" || jobs=-j2
71
72 find_installed () {
KO
+6 -4
@@ -3,6 +3,8 @@
3 # Not for general consumption; a script I used to make sure
4 # I do not accidentally push a rewound master to public.
5
6 +MASTER=master
7 +
8 no_fetch= ko=ko
9 while :
10 do
@@ -19,14 +21,14 @@ then
21 git fetch "$ko"
22 fi
23
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)
26 if test "$h" != 1
27 then
26 - echo "OOOOOPPPPPPPPPPPPPPSSS! master is not $ko/master fast forward."
28 + echo "OOOOOPPPPPPPPPPPPPPSSS! $MASTER is not $ko/$MASTER fast forward."
29 exit 1
30 fi
29 -git show-branch --topo-order $ko/master master
31 +git show-branch --topo-order $ko/$MASTER $MASTER
32 git show-branch --topo-order $ko/maint maint
33 git show-branch --topo-order $ko/next next
34 git show-branch --topo-order $ko/seen seen
ML
+3 -1
@@ -1,7 +1,9 @@
1 #!/bin/sh
2 # Merge later...
3
4 -: "${target:=maint}" "${here:=master}"
4 +MASTER=master
5 +
6 +: "${target:=maint}" "${here:=$MASTER}"
7
8 # Read from RelNotes and find mergeable topics
9 search_topics () {
Make
+3 -1
@@ -1,5 +1,7 @@
1 #!/bin/sh
2
3 +MASTER=master
4 +
5 if test -z "$GIT"
6 then
7 case "$(git version 2>/dev/null)" in
@@ -215,7 +217,7 @@ export LANG LC_ALL
217 branch=$(determine_branch)
218
219 case "$branch" in
218 -next | maint | master | seen | jch)
220 +next | maint | $MASTER | seen | jch)
221 prefix="$inst_prefix/git-$branch"
222 ;;
223 snap)
WCBCC
+2 -1
@@ -1,5 +1,6 @@
1 #!/bin/sh
2
3 +MASTER=master
4 BASE=${1-HEAD}
5
6 (
@@ -12,7 +13,7 @@ BASE=${1-HEAD}
13 echo "$branch"
14 done
15 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'
17 ) |
18 xargs git shortlog -s -e --no-merges |
19 sed -e 's/.*</ </' -e '$q' -e 's/$/,/'
amlook
+3 -1
@@ -4,6 +4,8 @@
4 # Meta/amlook id1 id2... (from the command line)
5 # Meta/amlook --gc
6
7 +MASTER=master
8 +
9 find_commit () {
10 in= commits=
11
@@ -43,7 +45,7 @@ find_commit () {
45 fi
46 case " $found " in
47 *' maint '*) in=maint ;;
46 - *' master '*) in=master ;;
48 + *" $MASTER "*) in=$MASTER ;;
49 *' next '*) in=next ;;
50 esac
51 if test -n "$in"
cook
+19 -16
@@ -1,6 +1,8 @@
1 #!/usr/bin/perl -w
2 # Maintain "what's cooking" messages
3
4 +my $MASTER = 'master'; # for now
5 +
6 use strict;
7
8 my %reverts = ('next' => {
@@ -66,7 +68,7 @@ sub topic_relation {
68 my $fh;
69 open($fh, '-|',
70 qw(git log --abbrev), "--format=%m %h",
69 - "$one...$two", "^master")
71 + "$one...$two", "^$MASTER")
72 or die "$!: open log --left-right";
73 my (@left, @right);
74 while (<$fh>) {
@@ -107,7 +109,7 @@ Returns a hash:
109 =cut
110
111 sub get_commit {
110 - my (@base) = qw(master next seen);
112 + my (@base) = ($MASTER, 'next', 'seen');
113 my $fh;
114 open($fh, '-|',
115 qw(git for-each-ref),
@@ -206,8 +208,8 @@ sub get_commit {
208
209 open($fh, '-|',
210 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";
213 while (<$fh>) {
214 my ($date, $commit, $parent, $tips);
215 unless (($date, $commit, $parent, $tips) =
@@ -220,7 +222,7 @@ sub get_commit {
222 $co->{'merged'} = " (merged to 'next' on $date at $commit)";
223 }
224 }
223 - close($fh) or die "$!: close log master..next";
225 + close($fh) or die "$!: close log $MASTER..next";
226
227 for my $branch (keys %topic) {
228 my @log = ();
@@ -300,7 +302,7 @@ EOF
302 To: git\@vger.kernel.org
303 Bcc: lwn\@lwn.net
304 Subject: What's cooking in git.git ($mon $year, #$issue; $dow, $date)
303 -X-master-at: $master_at
305 +X-$MASTER-at: $master_at
306 X-next-at: $next_at
307
308 What's cooking in git.git ($mon $year, #$issue; $dow, $date)
@@ -314,7 +316,7 @@ EOF
316
317 my $blurb_match = <<'EOF';
318 (?:(?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})
320 X-next-at: ([0-9a-f]{40})
321
322 What's cooking in \S+ \(\1 \2, #\3; \4, \5\)
@@ -476,7 +478,7 @@ sub write_cooking {
478 close($fh);
479 }
480
479 -my $graduated = 'Graduated to "master"';
481 +my $graduated = "Graduated to '$MASTER'";
482 my $new_topics = 'New Topics';
483 my $discarded = 'Discarded';
484 my $cooking_topics = 'Cooking';
@@ -488,11 +490,11 @@ sub update_issue {
490 open($fh, '-|',
491 qw(git for-each-ref),
492 "--format=%(refname:short) %(objectname)",
491 - "refs/heads/master",
493 + "refs/heads/$MASTER",
494 "refs/heads/next") or die "$!: open for-each-ref";
495 while (<$fh>) {
496 my ($branch, $at) = /^(\S+) (\S+)$/;
495 - if ($branch eq 'master') { $master_at = $at; }
497 + if ($branch eq $MASTER) { $master_at = $at; }
498 if ($branch eq 'next') { $next_at = $at; }
499 }
500 close($fh) or die "$!: close for-each-ref";
@@ -564,11 +566,11 @@ sub tweak_willdo {
566 my $text = $td->{'text'};
567
568 if (!defined $mergetomaster) {
567 - my $master = `git describe master`;
569 + my $master = `git describe $MASTER`;
570 if ($master =~ /-rc\d+(-\d+-g[0-9a-f]+)?$/) {
571 $mergetomaster = "Will cook in 'next'.";
572 } else {
571 - $mergetomaster = "Will merge to 'master'.";
573 + $mergetomaster = "Will merge to '$MASTER'.";
574 }
575 }
576
@@ -580,7 +582,7 @@ sub tweak_willdo {
582 if ($desc =~ /^ \(merged to 'next'/m) {
583 $text =~ s/^ Will merge to 'next'\.$/ $mergetomaster/m;
584 $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;
586 }
587 $td->{'text'} = $text;
588 }
@@ -590,7 +592,7 @@ sub tweak_graduated {
592
593 # Remove the "Will merge" marker from topics that have graduated.
594 for ($td->{'text'}) {
593 - s/\n Will merge to 'master'\.(\n|$)//s;
595 + s/\n Will merge to '$MASTER'\.(\n|$)//s;
596 }
597 }
598
@@ -825,12 +827,13 @@ sub havedone {
827 my ($topic, $to_maint, %to_maint, %merged, $in_desc);
828 if (!@ARGV) {
829 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))
832 or die "$!: open rev-list";
833 my ($rev) = <$fh>;
834 close($fh) or die "$!: close rev-list";
835 chomp $rev;
833 - @ARGV = ("$rev..master");
836 + @ARGV = ("$rev..$MASTER");
837 }
838 open($fh, '-|',
839 qw(git log --first-parent --oneline --reverse), @ARGV)