author | Pascal Volk <user@localhost.localdomain.org> |
Sun, 21 Nov 2021 22:04:40 +0000 | |
changeset 762 | 0147c0a9ce2b |
permissions | -rwxr-xr-x |
762
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
1 |
#!/bin/sh |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
2 |
# |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
3 |
# Copyright (c) 2006, 2008 Junio C Hamano |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
4 |
# |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
5 |
# The "pre-rebase" hook is run just before "git rebase" starts doing |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
6 |
# its job, and can prevent the command from running by exiting with |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
7 |
# non-zero status. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
8 |
# |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
9 |
# The hook is called with the following parameters: |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
10 |
# |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
11 |
# $1 -- the upstream the series was forked from. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
12 |
# $2 -- the branch being rebased (or empty when rebasing the current branch). |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
13 |
# |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
14 |
# This sample shows how to prevent topic branches that are already |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
15 |
# merged to 'next' branch from getting rebased, because allowing it |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
16 |
# would result in rebasing already published history. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
17 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
18 |
publish=next |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
19 |
basebranch="$1" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
20 |
if test "$#" = 2 |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
21 |
then |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
22 |
topic="refs/heads/$2" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
23 |
else |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
24 |
topic=`git symbolic-ref HEAD` || |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
25 |
exit 0 ;# we do not interrupt rebasing detached HEAD |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
26 |
fi |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
27 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
28 |
case "$topic" in |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
29 |
refs/heads/??/*) |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
30 |
;; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
31 |
*) |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
32 |
exit 0 ;# we do not interrupt others. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
33 |
;; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
34 |
esac |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
35 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
36 |
# Now we are dealing with a topic branch being rebased |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
37 |
# on top of master. Is it OK to rebase it? |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
38 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
39 |
# Does the topic really exist? |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
40 |
git show-ref -q "$topic" || { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
41 |
echo >&2 "No such branch $topic" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
42 |
exit 1 |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
43 |
} |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
44 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
45 |
# Is topic fully merged to master? |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
46 |
not_in_master=`git rev-list --pretty=oneline ^master "$topic"` |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
47 |
if test -z "$not_in_master" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
48 |
then |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
49 |
echo >&2 "$topic is fully merged to master; better remove it." |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
50 |
exit 1 ;# we could allow it, but there is no point. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
51 |
fi |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
52 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
53 |
# Is topic ever merged to next? If so you should not be rebasing it. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
54 |
only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
55 |
only_next_2=`git rev-list ^master ${publish} | sort` |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
56 |
if test "$only_next_1" = "$only_next_2" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
57 |
then |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
58 |
not_in_topic=`git rev-list "^$topic" master` |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
59 |
if test -z "$not_in_topic" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
60 |
then |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
61 |
echo >&2 "$topic is already up to date with master" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
62 |
exit 1 ;# we could allow it, but there is no point. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
63 |
else |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
64 |
exit 0 |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
65 |
fi |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
66 |
else |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
67 |
not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
68 |
/usr/bin/perl -e ' |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
69 |
my $topic = $ARGV[0]; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
70 |
my $msg = "* $topic has commits already merged to public branch:\n"; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
71 |
my (%not_in_next) = map { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
72 |
/^([0-9a-f]+) /; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
73 |
($1 => 1); |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
74 |
} split(/\n/, $ARGV[1]); |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
75 |
for my $elem (map { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
76 |
/^([0-9a-f]+) (.*)$/; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
77 |
[$1 => $2]; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
78 |
} split(/\n/, $ARGV[2])) { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
79 |
if (!exists $not_in_next{$elem->[0]}) { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
80 |
if ($msg) { |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
81 |
print STDERR $msg; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
82 |
undef $msg; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
83 |
} |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
84 |
print STDERR " $elem->[1]\n"; |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
85 |
} |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
86 |
} |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
87 |
' "$topic" "$not_in_next" "$not_in_master" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
88 |
exit 1 |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
89 |
fi |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
90 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
91 |
<<\DOC_END |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
92 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
93 |
This sample hook safeguards topic branches that have been |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
94 |
published from being rewound. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
95 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
96 |
The workflow assumed here is: |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
97 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
98 |
* Once a topic branch forks from "master", "master" is never |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
99 |
merged into it again (either directly or indirectly). |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
100 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
101 |
* Once a topic branch is fully cooked and merged into "master", |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
102 |
it is deleted. If you need to build on top of it to correct |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
103 |
earlier mistakes, a new topic branch is created by forking at |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
104 |
the tip of the "master". This is not strictly necessary, but |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
105 |
it makes it easier to keep your history simple. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
106 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
107 |
* Whenever you need to test or publish your changes to topic |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
108 |
branches, merge them into "next" branch. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
109 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
110 |
The script, being an example, hardcodes the publish branch name |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
111 |
to be "next", but it is trivial to make it configurable via |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
112 |
$GIT_DIR/config mechanism. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
113 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
114 |
With this workflow, you would want to know: |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
115 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
116 |
(1) ... if a topic branch has ever been merged to "next". Young |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
117 |
topic branches can have stupid mistakes you would rather |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
118 |
clean up before publishing, and things that have not been |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
119 |
merged into other branches can be easily rebased without |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
120 |
affecting other people. But once it is published, you would |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
121 |
not want to rewind it. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
122 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
123 |
(2) ... if a topic branch has been fully merged to "master". |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
124 |
Then you can delete it. More importantly, you should not |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
125 |
build on top of it -- other people may already want to |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
126 |
change things related to the topic as patches against your |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
127 |
"master", so if you need further changes, it is better to |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
128 |
fork the topic (perhaps with the same name) afresh from the |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
129 |
tip of "master". |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
130 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
131 |
Let's look at this example: |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
132 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
133 |
o---o---o---o---o---o---o---o---o---o "next" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
134 |
/ / / / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
135 |
/ a---a---b A / / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
136 |
/ / / / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
137 |
/ / c---c---c---c B / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
138 |
/ / / \ / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
139 |
/ / / b---b C \ / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
140 |
/ / / / \ / |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
141 |
---o---o---o---o---o---o---o---o---o---o---o "master" |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
142 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
143 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
144 |
A, B and C are topic branches. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
145 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
146 |
* A has one fix since it was merged up to "next". |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
147 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
148 |
* B has finished. It has been fully merged up to "master" and "next", |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
149 |
and is ready to be deleted. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
150 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
151 |
* C has not merged to "next" at all. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
152 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
153 |
We would want to allow C to be rebased, refuse A, and encourage |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
154 |
B to be deleted. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
155 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
156 |
To compute (1): |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
157 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
158 |
git rev-list ^master ^topic next |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
159 |
git rev-list ^master next |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
160 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
161 |
if these match, topic has not merged in next at all. |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
162 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
163 |
To compute (2): |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
164 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
165 |
git rev-list master..topic |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
166 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
167 |
if this is empty, it is fully merged to "master". |
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
168 |
|
0147c0a9ce2b
Added a README and the files of the empty vmm.git
Pascal Volk <user@localhost.localdomain.org>
parents:
diff
changeset
|
169 |
DOC_END |