Next: Initializing vc-dwim, Up: vc-dwim [Contents]
Use an alias like this to show all or specified diffs:
alias cv='vc-dwim --diff'
Use that when you want to see diffs of a specified file, regardless
of whether you have written new ChangeLog entries for it.
It works the same for bzr
, cvs
, git
,
hg
, svn
, and darcs
repositories, as long
as all you want are the
difference between your local copy and the checked out version.
Let’s say you have made local changes to a file, and you’ve also added
at least one corresponding entry in a ChangeLog file. Then, you
can use vc-dwim ChangeLog
to print the diffs for which there are
ChangeLog entries, warning about the potential problems mentioned
above (editor temporaries that can imply there are unsaved changes, and
files listed in ChangeLog, but not cvs add
ed). If your
changes affect files covered by more than one ChangeLog, you might use
vc-dwim ChangeLog lib/ChangeLog
, or more concisely, vc-dwim
{,lib/}ChangeLog
.
Use vc-dwim --commit ChangeLog
or vc-dwim --commit ChangeLog lib/ChangeLog src/ChangeLog
to commit the changes you would see without the --commit option.
Assuming you have completed a change and have documented everything in
one or more ChangeLog file, run vc-dwim --commit ChangeLog
to commit that ChangeLog file and the files “implied” by the
new ChangeLog lines. The commit log message is derived from the added
ChangeLog lines. With a single ChangeLog file, the log
message is nearly identical to the list of added lines. One leading
TAB is removed and any date user-name <email>
lines are
elided. When there are two or more ChangeLog files, the log
message includes a line for each indicating the affected directory.
For example:
[ChangeLog] * some-file-in-top-level-dir: ... [lib/ChangeLog] * lib.c: ... [m4/ChangeLog] * foo.m4: ...
After committing a change, do not erase or edit the ChangeLog file. When writing further changes, just prepend to the top of ChangeLog, as usual. vc-dwim requires that the only changes to ChangeLog are additions at the beginning of the file. If you feel the need to edit past log entries, this needs to be done in the VC log, not by editing ChangeLog.
Next: Initializing vc-dwim, Up: vc-dwim [Contents]