setup_config();
+run_git__anyoutput(qw(diff --cached --name-only HEAD --
+
if (!run_git_test_anyoutput(qw(diff --name-only HEAD -- .topbloke/msg)) {
- open NM, '>', ".topbloke/msg.tmp" or die $!;
+ my $nm = wf_start('.topbloke/msg');
my $author = run_git_1line(qw(var GIT_AUTHOR_IDENT));
$author =~ s/ \d+ [-+]\d+$//;
- print NM "From: $author\n" or die $!;
+ wf($nm, "From: $author\n");
foreach my $h (qw(To CC BCC)) {
my $estatus;
- run_git(\$estatus, sub { print NM "$h: $_" or die $!; },
+ run_git(\$estatus, sub { wf($nm, "$h: $_") or die $!; },
qw(config), "topbloke.".lc $h);
die "$h $estatus" unless $estatus==0 || $estatus==256;
}
$subjprefix = git_config('topbloke.subjectprefix', '');
- print NM <END or die $!;
+ wf($n, <END) or die $!;
Subject: [${subprefix}PATCH] $spec->{Nick}
<patch description>
Signed-off-by: $author
END
+ wf_done($nm);
run_git(qw(add .topbloke/msg));
print " created and staged new .topbloke/msg\n";
} else {
- if (!run_git_test_anyoutput(qw(diff --cached --name-only HEAD --
- .topblokemsg))) {
+ if (!
print " staged your modified .topbloke/msg\n";
run_git(qw(add .topbloke/msg));
} else {
}
}
+sub meta_and_stage ($$) {
+ my ($file, $contents) = @_;
+ wf_contents(".topbloke/$file", $contents);
+ run_git(qw(add), ".topbloke/$file");
+}
+
+meta_and_stage("deps", $current->{DepSpec}."\n");
+meta_and_stage("flags", '');
+
+if ($current->{Kind} eq 'foreign') {
+ meta_and_stage('included', $current->{DepSpec});
+