[darcs-users] darcs patch: Remove duplicated documentation. (and 4 more)

Eric Kow kowey at darcs.net
Sun Sep 20 19:53:48 UTC 2009


On Sun, Sep 20, 2009 at 17:30:31 +1000, Trent W.Buck wrote:
> These are all orthogonal -- if some are OK to apply immediately and
> others are held during review, please apply the former right away.

> Mon Sep 14 13:38:22 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Remove duplicated documentation.
>
> Sun Sep 20 16:38:13 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Remove an obsolete remark from TeX.
> 
> Sun Sep 20 17:17:21 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Rewrite "darcs show repo" help.

I've applied these three

> Mon Sep 14 13:41:23 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Delete unhelpful documentation.
> 
> Mon Sep 14 16:23:29 EST 2009  Trent W. Buck <trentbuck at gmail.com>
>   * Rewrite "darcs diff" help.

I'll leave these two for somebody else to look at.

Note: this would be an excellent chance for non-darcs-hacking users to
contribute to patch review!  We need your user perspective...

Delete unhelpful documentation.
-------------------------------
> Trent W. Buck <trentbuck at gmail.com>**20090914034123
>  Ignore-this: 2e143e68b9893a6add45b7b8c60cc9bb
> ] hunk ./src/Darcs/Commands/Replace.lhs 111
>   "[[:alnum:]]) are NOT supported by --token-chars, and will be silently\n" ++
>   "treated as a simple set of characters.\n"
>  
> --- FIXME: can  we just  delete the remaining  text?  It seems  more an
> --- instance of "look how clever  I am; I made commutation work" rather
> --- than information that is actually useful to users.
> -\end{code}
> -There is a potentially confusing difference, however, when a replace is
> -used to make another replace possible:
> -\begin{verbatim}
> -$ darcs replace newtoken aaack ./foo.c
> -$ darcs replace oldtoken newtoken ./foo.c
> -$ darcs record
> -\end{verbatim}
> -will be valid, even if \verb!newtoken! and \verb!oldtoken! are both present
> -in the recorded version of foo.c, while the sequence
> -\begin{verbatim}
> -$ [manually edit foo.c replacing newtoken with aaack]
> -$ darcs replace oldtoken newtoken ./foo.c
> -\end{verbatim}
> -will fail because ``newtoken'' still exists in the recorded version of
> -\verb!foo.c!.  The reason for the difference is that when recording, a
> -``replace'' patch always is recorded \emph{before} any manual changes,
> -which is usually what you want, since often you will introduce new
> -occurrences of the ``newtoken'' in your manual changes.  In contrast,
> -multiple ``replace'' changes are recorded in the order in which
> -they were made.
> -\begin{code}
> -
>  replace :: DarcsCommand
>  replace = DarcsCommand {command_name = "replace",
>                          command_help = replace_help,

Rewrite "darcs diff" help.
--------------------------
> Trent W. Buck <trentbuck at gmail.com>**20090914062329
>  Ignore-this: 40af7fcae616be8ca5b2ad780ebd349d
> ] hunk ./src/Darcs/Commands/Diff.lhs 63
>  diff_description :: String
>  diff_description = "Create a diff between two versions of the repository."
>  
> +-- FIXME: needs more rewriting --twb, Sep 2009.
>  diff_help :: String
>  diff_help =
>   "Diff can be used to create a diff between two versions which are in your\n"++
> hunk ./src/Darcs/Commands/Diff.lhs 69
>   "repository.  Specifying just --from-patch will get you a diff against\n"++
>   "your working copy.  If you give diff no version arguments, it gives\n"++
> - "you the same information as whatsnew except that the patch is\n"++
> - "formatted as the output of a diff command\n"
> + "you the same information as whatsnew.\n" ++
> + "\n" ++
> + "If you specify a set of files and directories, only unrecorded\n" ++
> + "changes to those files and directories are listed.\n" ++
> + "\n" ++
> + "Diff calls the external utility diff(1) to do the actual work.\n" ++
> + "You can specify additional arguments to diff using the `--diff-opts'\n" ++
> + "flag, such as --diff-opts=-ud.\n" ++
> + "\n" ++
> + "The --diff-command option can be used to specify an alternate utility,\n" ++
> + "such as meld (GNOME) or opendiff (OS X).  Arguments may be included,\n" ++
> + "separated by whitespace.  The value is not interpreted by a shell, so\n" ++
> + "shell constructs cannot be used.  The arguments %1 and %2 MUST be\n" ++
> + "included, these are substituted for the two working trees being\n" ++
> + "compared.  If this option is used, --diff-opts is ignored.\n"
>  
>  diff_command :: DarcsCommand
>  diff_command = DarcsCommand {command_name = "diff",
> hunk ./src/Darcs/Commands/Diff.lhs 101
>                                                       diff_cmd_flag,
>                                                       diffflags, unidiff,
>                                                       working_repo_dir, store_in_memory]}
> -\end{code}
> -
> -\begin{options}
> ---diff-opts
> -\end{options}
> -
> -Diff calls an external ``diff'' command to do the actual work, and passes
> -any unrecognized flags to this diff command.  Thus you can call
> -\begin{verbatim}
> -% darcs diff -t 0.9.8 -t 0.9.10 -- -u
> -\end{verbatim}
> -to get a diff in the unified format.  Actually, thanks to the wonders of
> -getopt you need the ``\verb!--!'' shown above before any arguments to diff.
> -You can also specify additional arguments to diff using the
> -\verb!--diff-opts! flag.  The above command would look like this:
> -\begin{verbatim}
> -% darcs diff --diff-opts -u -t 0.9.8 -t 0.9.10
> -\end{verbatim}
> -This may not seem like an improvement, but it really pays off when you want
> -to always give diff the same options.  You can do this by adding
> -\begin{verbatim}
> -% diff diff-opts -udp
> -\end{verbatim}
> -to your \verb!_darcs/prefs/defaults! file.
>  
> hunk ./src/Darcs/Commands/Diff.lhs 102
> -\begin{code}
>  get_diff_opts :: [DarcsFlag] -> [String]
>  get_diff_opts [] = []
>  get_diff_opts (Unified:fs) = "-u" : get_diff_opts fs
> hunk ./src/Darcs/Commands/Diff.lhs 128
>    helper [] = -- if no command specified, use 'diff'
>      Right (cmd, ("-rN":get_diff_opts opts++[f1,f2]))
>    helper (_:t) = helper t
> -\end{code}
> -
> -If you want to view only the differences to one or more files, you can do
> -so with a command such as
> -\begin{verbatim}
> -% darcs diff foo.c bar.c baz/
> -\end{verbatim}
>  
> hunk ./src/Darcs/Commands/Diff.lhs 129
> -\begin{options}
> ---diff-command
> -\end{options}
> -
> -You can use a different program to view differences by including
> -the flag \verb!--diff-command!, e.g.
> -\begin{verbatim}
> ---diff-command 'opendiff %1 %2'.
> -\end{verbatim}
> -The \verb!%1! and \verb!%2!  are replaced with the two versions to be
> -merged.  The above example works with the FileMerge.app tool that comes with
> -Apple's developer tools.  To use xxdiff, you would use
> -\begin{verbatim}
> ---diff-command 'xxdiff %1 %2'
> -\end{verbatim}
> -To use \verb!kdiff3!, you can use
> -\begin{verbatim}
> ---diff-command 'kdiff3 %1 %2'
> -\end{verbatim}
> -
> -Note that the command is split into space-separated words and the first one is
> -\verb!exec!ed with the rest as arguments---it is not a shell command.  Also
> -the substitution of the \verb!%! escapes is only done on complete words.
> -See \ref{resolution} for how you might work around this fact, for example,
> -with Emacs' Ediff package.
> -
> -Note also that the \verb!--diff-opts! flag is ignored if you use this option.
> -
> -\begin{code}
>  diff_cmd :: [DarcsFlag] -> [String] -> IO ()
>  diff_cmd opts args = withRepository opts $- \repository -> do
>    when (not (null [i | LastN i <- opts])
> hunk ./src/Darcs/Commands/Diff.lhs 198
>  changelog :: [PatchInfo] -> Doc
>  changelog pis = vcat $ map human_friendly pis
>  \end{code}
> -

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090920/f52b4552/attachment.pgp>


More information about the darcs-users mailing list