diff --git a/commit-patch b/commit-patch index cf88be2..09dba3f 100755 --- a/commit-patch +++ b/commit-patch @@ -98,3 +98,116 @@ if ($@) { die "Failed: $@"; } foreach my $k (keys %clean) { unlink $k } + + +=head1 NAME + +commit-patch - commit patches to I, I or I repositories + +=head1 SYNOPSIS + +commit-patch [B<-m> I] I + +=head1 DESCRIPTION + +Normally version control systems don't allow fine grained +commits. B allows the user to control I what +gets committed (or "recorded", in I parlance) by letting the user +supply a patch to be committed rather than using the files in the +current working directory. + +B currently supports the following version control systems: +B>, B>, and B>. + +=head1 OPTIONS + +B<-m>, B<--message>=I - An optional I to use as the commit +text. If the message is multiple lines then I and I +will use the first line as the patch name and the rest as commit +details. If the C<-m> option is not specified then the result will be +the same as whatever the underlying version control system would do if +you didn't specify a message name on the command line. That is, +B does not interfere with the patch naming process of +the underlying version control system; I will still ask you +interactively and I will still launch your editor. + +=head1 DIAGNOSTICS + +B works by manipulating the working directory using +C, C, and the underlying version control system's +C. If any part of the process fails, B will +attempt to restore the working directory to the state it was before +the command was run. Any errors from the underlying version control +system or from patch will be printed. + +=head1 CAVEATS + +The patch specified on the command line must originate from the same +place as the current directory. That is, the following will not work: + + cvs diff -u > ../a.patch + cd .. + commit-patch a.patch + +You B run B from the same directory that the +original patch was based from. + +I and I put C and C in front of all the paths +in the diff output. Don't worry about this; B takes it into +account. + +=head1 EXAMPLES + +Typical I usage: + + cvs diff -u > a.patch + emacs a.patch + commit-patch a.patch + +I usage with a message specified: + + hg diff > a.patch + emacs a.patch + commit-patch -m "This is a commit message" a.patch + +I usage with a multi-line message specified: + + darcs diff -u > a.patch + emacs a.patch + commit-patch -m 'This is the patch name + Here are the patch details' a.patch + +=head1 AUTHORS + +=over + +=item * + +David Caldwell + +=item * + +Jim Radford + +=back + +=head1 COPYRIGHT AND LICENSE + +Copyright 2003-2006 by David Caldwell and Jim Radford. + +B is distributed under the GNU General Public +License. See the COPYING file in the distribution for more details. + +=head1 HISTORY + +B was originally called C and was a +bash script written in 2003 by Jim Radford (with David Caldwell in the +room drawing the procedure on a white board). David later converted it +do C, then integrated them back together into +B. I support was then added. At some point +David translated from bash into perl because funky bash quoting issues +were causing problems with a repository that had a space in one of the +directory names. + +=cut +