vc-dwim [option...]vc-dwim [option...]vc-dwim [option...]vc-dwim [option...]
By default, each command line argument should be a locally modified,
version-controlled ChangeLog file. If there is no command line
vc-dwim tries to use the ChangeLog file in
the current directory. In this default mode,
vc-dwim works by
first computing diffs of those files and parsing the diff output to
determine which named files are being changed. Then, it diffs the
affected files and prints the resulting output. One advantage of using
this tool is that before printing any diffs, it warns you if it sees
that a ChangeLog or an affected file has unsaved changes. It
detects that by searching for an editor temporary file corresponding to
each affected file. Another common error you can avoid with this tool
is the one where you create a new file, add its name to
Makefiles, etc., mention the addition in ChangeLog but
forget to e.g.,
git add (or
hg add, etc.) the file to the
version control system.
vc-dwim detects this discrepancy and
fails with a diagnostic explaining the probable situation. You might
also have simply mistyped the file name in the ChangeLog.
Once you are happy with your ChangeLog-derived diffs, you can commit those changes and the ChangeLog simply by rerunning the command with the --commit option.
But what if you’d like to use
vc-dwim on a project that
doesn’t have or want a ChangeLog file? In that case, you can
maintain your own, private, version-controlled ChangeLog file in
a different hierarchy. Then just make a symlink to it from the top
level directory of the hierarchy in which you’d like to use it and
everything should work. Your private ChangeLog file need not
even use the same version control system as the rest of the project
vc-dwim accepts the following options:
Display help and exit.
Output version information and exit.
Specify the user name and email address of the author of this change set.
Perform the commit, too.
Determine which version control system manages the first file, then use that to print diffs of the named files. If no file is specified, print all diffs for the current hierarchy.
Print the list of recognized version control names, then exit.
Generate verbose output.
Generate debug output.
This tool can be useful to you only if you use a version control system. It’s most useful if you maintain a ChangeLog file and create a log entry per file per “commit” operation.
Relies on fairly strict adherence to recommended ChangeLog syntax. Detects editor temporaries created by Emacs and Vim. Eventually, it will detect temporaries created by other editors.