chiark / gitweb /
Commentary: explain why pseudomerges are the way round they are
[dgit.git] / git-debrebase
index 7c8d54dbc558208a1aecb7bfa890275f8ca4d2ac..f6d379ac81b036e4be6682e1a25b9c24a9b867ef 100755 (executable)
@@ -18,6 +18,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+END { $? = $Debian::Dgit::ExitStatus::desired // -1; };
+use Debian::Dgit::ExitStatus;
+
 use strict;
 
 use Debian::Dgit qw(:DEFAULT :playground);
@@ -39,7 +42,7 @@ our $us = qw(git-debrebase);
 sub badusage ($) {
     my ($m) = @_;
     print STDERR "bad usage: $m\n";
-    exit 12;
+    finish 8;
 }
 
 sub cfg ($;$) {
@@ -1083,6 +1086,8 @@ sub stitch ($$$$$) {
        }
     }
     fresh_workarea();
+    # We make pseudomerges with L as the contributing parent.
+    # This makes git rev-list --first-parent work properly.
     my $new_head = make_commit [ $old_head, $ffq_prev ], [
        'Declare fast forward / record previous work',
         "[git-debrebase pseudomerge: $prose]",
@@ -1582,3 +1587,5 @@ if (!@ARGV || $opt_defaultcmd_interactive || $ARGV[0] =~ m{^-}) {
     $cmdfn or badusage "unknown git-debrebase sub-operation $cmd";
     $cmdfn->();
 }
+
+finish 0;