Hi,
I am sending this patch for comments only at this point. It is not intended
for inclusion, at least until there is a bit of discussion about it.
With the current behavior of darcs, patches sent with the 'send' command do not
have a filename associated with them. If you choose to save the attachment,
rather than apply it directly, you have to manually give it a meaningful name.
This patch is my first attempt at automatically naming the file based on the
summary of the patch. As it stands, the auto-naming is very rough. I didn't
want to go too far with it until I had some comments about the idea itself
(okay, okay, and because I don't know much Haskell and sometimes it takes me a
while to find out how to do what I want).
Cogito (the GIT wrapper) does something similar with the following sed command:
sed -n '/^$/{n;
s/^[ \t]*\[[^]]*\][ \t]*//;
s/[:., \t][:., \t]*/-/g;
s/_/-/g;
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
s/[^a-zA-Z0-9-]//g;
Right now I only remove all non alphanumeric characters and convert spaces to
underscores.
So, for any interested parties, I'd appreciate it if you could comment on if
the feature seems useful and if the implementation is okay. Also, given that I
don't really know Haskell, any comments on my coding style would be much
appreciated.
Sat Nov 19 12:23:37 EST 2005 Zachary P. Landau <[EMAIL PROTECTED]>
* added autonaming of attachment created by send
Added support for generating a filename for the attachment created by send
that
is based off the first patch's name.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
New patches:
[added autonaming of attachment created by send
Zachary P. Landau <[EMAIL PROTECTED]>**20051119172337
Added support for generating a filename for the attachment created by send that
is based off the first patch's name.
] {
hunk ./Email.hs 4
- -import Printer ( Doc, ($$), (<+>), text, packedString, renderPS )
+import Printer ( Doc, ($$), (<+>), (<>), text, packedString, renderPS )
hunk ./Email.hs 92
- -make_email :: String -> Doc -> Doc -> Doc
- -make_email repodir contents bundle =
+make_email :: String -> Doc -> Doc -> String -> Doc
+make_email repodir contents bundle filename =
hunk ./Email.hs 105
- - $$ text "Content-Type: text/x-darcs-patch"
+ $$ text "Content-Type: text/x-darcs-patch; name=\"" <> (text filename) <> text "\""
hunk ./FileName.lhs 24
- - break_on_dir, norm_path, own_name, super_name,
+ break_on_dir, norm_path, own_name, super_name, patch_filename,
hunk ./FileName.lhs 29
- -import Char ( isSpace, chr, ord )
+import Char ( isAlpha, isSpace, isDigit, chr, ord, toLower )
hunk ./FileName.lhs 124
+
+validFileChars :: Char -> Bool
+validFileChars char = isAlpha char || isDigit char || isSpace char
+
+mapFileChars :: Char -> Char
+mapFileChars char = case char of
+ ' ' -> '_'
+ _ -> toLower char
+
+patch_filename :: String -> String
+patch_filename summary =
+ map mapFileChars (filter validFileChars summary) ++ ".dpatch"
hunk ./Send.lhs 54
+import FileName ( patch_filename )
hunk ./Send.lhs 167
- - bundle $ make_email their_name mailcontents bundle
+ bundle $ make_email their_name mailcontents
+ bundle (patch_filename (patch_desc (head to_be_sent)))
hunk ./unit.lhs 160
- - $ make_email "reponame" (text "contents\n")
+ $ make_email "reponame" (text "contents\n") "textname"
}
Context:
[Merge changes
Ian Lynagh <[EMAIL PROTECTED]>**20051008225210]
[specify default --author in whatsnew.pl.
David Roundy <[EMAIL PROTECTED]>**20051007235714]
[fix bug in whatsnew on files without trailing newlines.
David Roundy <[EMAIL PROTECTED]>**20051004124355]
[add test for whatsnew -s on file without newline.
David Roundy <[EMAIL PROTECTED]>**20050905123225]
[remove old footnote that caused doc-building trouble.
David Roundy <[EMAIL PROTECTED]>**20051008002612]
[use prefix and userchunkPS in coolContextHunk
Tommy Pettersson <[EMAIL PROTECTED]>**20050923093032
This makes escaping of trailing spaces work in unified output.
]
[add changelog entry for bug #512.
David Roundy <[EMAIL PROTECTED]>**20051007123717]
[make --summary have effect in interactive commands
David Roundy <[EMAIL PROTECTED]>**20051007123507]
[make --dry-run --summary indent the summaries like changes does.
David Roundy <[EMAIL PROTECTED]>**20051007123427]
[Fix typos in description of unpull.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20051006204813
Thanks to frithjof.
]
[avoid excess printing in set_scripts_executable.pl.
David Roundy <[EMAIL PROTECTED]>**20051007112545]
[fix documentation typos
Andres Loeh <[EMAIL PROTECTED]>**20050918175732]
[description environment for explanation of --summary flags
Andres Loeh <[EMAIL PROTECTED]>**20050918175612]
[remove/change/fix some quotation marks
Andres Loeh <[EMAIL PROTECTED]>**20050918171105]
[remove occurrences of \bf, \tt, and \em
Andres Loeh <[EMAIL PROTECTED]>**20050918170214]
[add executable bit support to Readable/WriteableDirectory.
David Roundy <[EMAIL PROTECTED]>**20051003123240]
[fix bug in set_scripts_executable test, and related bug in apply.
David Roundy <[EMAIL PROTECTED]>**20051006111849]
[clean up tests/set_scripts_executable.pl.
David Roundy <[EMAIL PROTECTED]>**20051004131951]
[make --set-scripts-executable work once again.
David Roundy <[EMAIL PROTECTED]>**20051004131756]
[remove occurances of "'" that messed up my emacs coloring...
David Roundy <[EMAIL PROTECTED]>**20050919122443]
[add two changelog entries.
David Roundy <[EMAIL PROTECTED]>**20051004132328]
[update copyright dates.
David Roundy <[EMAIL PROTECTED]>**20051004131936]
[only use ascii chars in quoted escapes of non-printable chars
Tommy Pettersson <[EMAIL PROTECTED]>**20050920163959
Haskell interprets Char as unicode regardless of the systems locale,
so isPrint can't be used the way it was used to find suitable escape
quotings. Ascii fortunately is unicode, so the simple fix is to restrict
escape quotings to only use (printable) ascii chars.
]
[Installation doc readability fixes
Thomas Zander <[EMAIL PROTECTED]>**20050924163649]
[simplify docs-- why "CVS" is in the boring file is self-evident.
Mark Stosberg <[EMAIL PROTECTED]>**20050927131847]
[add two new changelog entries.
David Roundy <[EMAIL PROTECTED]>**20050910110115]
[fix bug in resolve.pl test.
David Roundy <[EMAIL PROTECTED]>**20050910103833]
[give better output on sftp errors.
David Roundy <[EMAIL PROTECTED]>**20050908125423]
[make darcs not generate null binary patches when diffing.
David Roundy <[EMAIL PROTECTED]>**20050907125129]
[make darcs able to eliminate null binary and hunk patches when coalescing.
David Roundy <[EMAIL PROTECTED]>**20050907125104]
[add test that adding and removing binary files leaves no change.
David Roundy <[EMAIL PROTECTED]>**20050907122509]
[fix some typos in comments
Conrad Parker <[EMAIL PROTECTED]>**20050904225715]
[Make print_dry_run_message_and_exit print summaries if All and Summary.
David Roundy <[EMAIL PROTECTED]>**20050904125434
This is a somewhat hokey way to make --all --summary print summary
messages.
]
[add changelog entry for configure script checking on darcs being present.
David Roundy <[EMAIL PROTECTED]>**20050905113258]
[fix bug where we tried to run darcs when darcs wasn't present.
David Roundy <[EMAIL PROTECTED]>**20050905112935]
[revert accidental directory name change in Test.
David Roundy <[EMAIL PROTECTED]>**20050904123424]
[add changelog entry for recent pristine bugfix.
David Roundy <[EMAIL PROTECTED]>**20050903134039]
[-add test script for --set-scripts-executable
Mark Stosberg <[EMAIL PROTECTED]>**20050901015046
It's currently failing because darcs is currently broken in this regard. I commented
out a "TODO" test in case you want to make to this a TODO test until
someone gets to it.
]
[clean up docs on flags directly to darcs (not to a darcs command).
David Roundy <[EMAIL PROTECTED]>**20050903124050]
[bump version to 1.0.4rc1.
David Roundy <[EMAIL PROTECTED]>**20050903114002]
[update the web page to direct new users first to the precompiled binaries rather than first to the source
[EMAIL PROTECTED]
[add test script that displays --no-pristine test-related bug.
David Roundy <[EMAIL PROTECTED]>**20050903132906]
[fix bug triggered by --no-pristine-tree and running test.
David Roundy <[EMAIL PROTECTED]>**20050903132055
The trouble was that the NoPristine version of createPristineDirectoryTree
would fail if the directory already exists, which isn't the intended
behavior. I also took this opportunity to remove the "stubbornly" function
and replace some stubborn directory creation with
createDirectoryIfMissing.
]
[don't create test directory if we don't want to actually run test.
David Roundy <[EMAIL PROTECTED]>**20050903130722]
[Change an rm_rf to a cleanup in tests/disable.pl
Ian Lynagh <[EMAIL PROTECTED]>**20050902024711]
[TAG 1.0.4pre4
David Roundy <[EMAIL PROTECTED]>**20050901110418]
[add changelog entry for makefile fix.
David Roundy <[EMAIL PROTECTED]>**20050901110353]
[bump version to 1.0.4pre4.
David Roundy <[EMAIL PROTECTED]>**20050901110210]
[fix DESTDIR syntax errors in makefile
Andres Loeh <[EMAIL PROTECTED]>**20050831192410]
[fix "No root path(s) specified at ..." testsuite problem.
David Roundy <[EMAIL PROTECTED]>**20050830121603]
[add test that triggers "too many open files" bug.
David Roundy <[EMAIL PROTECTED]>**20050827192215
We just need to pull over 1024 patches at once to trigger this bug on my
linux system.
]
[TAG 1.0.4pre3
David Roundy <[EMAIL PROTECTED]>**20050831115448]
[add two changelog entries.
David Roundy <[EMAIL PROTECTED]>**20050831113335]
[only create directories on install if they don't exist (bug #494)
David Roundy <[EMAIL PROTECTED]>**20050831113142]
[fix bug in whatsnew -l -l (rt#501).
David Roundy <[EMAIL PROTECTED]>**20050831110552]
[fix typo in docs.
David Roundy <[EMAIL PROTECTED]>**20050831002520]
[fix --posthook code to pass tests.
David Roundy <[EMAIL PROTECTED]>**20050830132225]
[add test for --disable.
David Roundy <[EMAIL PROTECTED]>**20050830132122]
[add changelog entry for --posthook.
David Roundy <[EMAIL PROTECTED]>**20050830132110]
[add skeleton posthook test.
David Roundy <[EMAIL PROTECTED]>**20050827123744]
[posthook documentation
Jason Dagit <[EMAIL PROTECTED]>**20050825045706]
[changed from --posthook-command to posthook
Jason Dagit <[EMAIL PROTECTED]>**20050825043414]
[now the posthook options appear for each command
Jason Dagit <[EMAIL PROTECTED]>**20050825043305]
[posthook for apply
Jason Dagit <[EMAIL PROTECTED]>**20050803070343
With this patch it is now possible to specify a command to run after every
successful apply.
]
[added run_posthook for actually running posthooks
Jason Dagit <[EMAIL PROTECTED]>**20050803070156
This adds the function run_posthook which should be used to run posthooks.
The code was added to Test.lhs, but there may be a better place for this code.
]
[added posthook command line switches
Jason Dagit <[EMAIL PROTECTED]>**20050803065956
Added generic posthook command line switches. This patch does not add any
posthooks to any command.
]
[Rewrite gcau, add explanatory comment from David and some TODO notes
Ian Lynagh <[EMAIL PROTECTED]>**20050830020943]
[update building darcs section of manual.
David Roundy <[EMAIL PROTECTED]>**20050829120152]
[add bench directory with a single script in it.
David Roundy <[EMAIL PROTECTED]>**20050828114118
See bench/README for discussion of the idea behind this.
]
[New implementation of comparePS, based on memcmp. 1/5 space usage, 96% faster
[EMAIL PROTECTED]
[Use substrPS-less versions of initPS and tailPS
[EMAIL PROTECTED]
[remove hideous malloc hack.
David Roundy <[EMAIL PROTECTED]>**20050818161411]
[change my AUTHORS email to [EMAIL PROTECTED]
David Roundy <[EMAIL PROTECTED]>**20050808124703]
[fix mkstemp implementation for win32
Peter Strand <[EMAIL PROTECTED]>**20050810211303]
[Implement parts of System.Posix.(IO|Files) for win32
[EMAIL PROTECTED]
[implement RawMode with library functions instead of ffi
[EMAIL PROTECTED]
[call hsc2hs without output filename argument
[EMAIL PROTECTED]
[Rename compat.c to c_compat.c to avoid object filename conflict with Compat.hs
[EMAIL PROTECTED]
[Move atomic_create/sloppy_atomic_create to Compat
Ian Lynagh <[EMAIL PROTECTED]>**20050730141703]
[Split the raw mode stuff out into its own .hsc file. Windows needs some TLC
Ian Lynagh <[EMAIL PROTECTED]>**20050730134030]
[Move maybe_relink out of compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730131205]
[Remove is_symlink
Ian Lynagh <[EMAIL PROTECTED]>**20050730122255]
[Move mkstemp to Compat.hs
Ian Lynagh <[EMAIL PROTECTED]>**20050730020918]
[Remove unused function
Ian Lynagh <[EMAIL PROTECTED]>**20050730010118]
[Start Compat.hs, and move stdout_is_a_pipe from compat.c
Ian Lynagh <[EMAIL PROTECTED]>**20050730004829]
[fix for bug Ian found in apply.
David Roundy <[EMAIL PROTECTED]>**20050811162558
This is the bug manifested in the cabal repository.
]
[fix compilation errors with ghc-6.2.2 on win32
Peter Strand <[EMAIL PROTECTED]>**20050809192759]
[Retain both Git's author and committer.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050810000820]
[Move slurping into syncPristine.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050809232101
Avoids creating a useless pristine tree when there is none. Thanks to
Ian for pointing this out.
]
[Split --relink into --relink and --relink-pristine.
Juliusz Chroboczek <[EMAIL PROTECTED]>**20050809230951
Relinking the pristine tree breaks handling of timestamps, which causes
Darcs to compare file contents. It should not be used unless you know
what you are doing.
]
[make repair work on partial repositories.
David Roundy <[EMAIL PROTECTED]>**20050805113001]
[Cleanup --verbose handling in repair command
Matt Lavin <[EMAIL PROTECTED]>**20050805020630]
[clean up Printer.wrap_text.
David Roundy <[EMAIL PROTECTED]>**20050808114844]
[add several changelog entries.
David Roundy <[EMAIL PROTECTED]>**20050808114800]
[improve EOD message a tad.
David Roundy <[EMAIL PROTECTED]>**20050807112644
This change also introduces a "wrapped_text" function in Printer, so we
won't have to worry so often about manually wrapping lines.
]
[changed ***DARCS*** to ***END OF DESCRIPTION***
Jason Dagit <[EMAIL PROTECTED]>**20050729032543]
[remove unused opts argument from apply_patches and apply_patches_with_feedback
Matt Lavin <[EMAIL PROTECTED]>**20050807031038]
[Use apply_patch_with_feedback from check and repair commands
Matt Lavin <[EMAIL PROTECTED]>**20050805020830]
[add code to read patch bundles with added CRs.
David Roundy <[EMAIL PROTECTED]>**20050806222631
I think this'll address bug #291.
]
[accept command-line flags in any order.
David Roundy <[EMAIL PROTECTED]>**20050806211828
In particular, we no longer require that --flags precede filename and
repository arguments.
]
[show patch numbers instead of dots on get
Matt Lavin <[EMAIL PROTECTED]>**20050804013649]
[add obliterate command as alias for unpull.
David Roundy <[EMAIL PROTECTED]>**20050804104929]
[Do not ask confirmation for revert -a
[EMAIL PROTECTED]
Giving -a as a parameter means the user expects all changes to be reverted.
Just like for unrevert and record go ahead with it do not ask for confirmation.
]
[clarify help text for 'd' in SelectPatches.
David Roundy <[EMAIL PROTECTED]>**20050806231117]
[Add --with-static-libs configure flag for linking static versions of libraries.
[EMAIL PROTECTED]
[add changelog entry for bug #477.
David Roundy <[EMAIL PROTECTED]>**20050806212148]
[changelog entry for bug #189.
David Roundy <[EMAIL PROTECTED]>**20050731132624]
[add description of how to add changelog entries to ChangeLog.README.
David Roundy <[EMAIL PROTECTED]>**20050806225901]
[Explain the missing ChangeLog
Mark Stosberg <[EMAIL PROTECTED]>**20050526135421
It should be easy for casual users and contributors to view and update the
ChangeLog.
Providing a README file in the place where people are most likely to look
provides a very useful clue.
However, it's still not clear to me exactly how the system works, so I have
left a stub to complete that documentation.
Mark
]
[fix obsolete error explanation in get_extra bug.
David Roundy <[EMAIL PROTECTED]>**20050804130610]
[simplify fix for bug 463; reuse /// from FilePathUtils
Matt Lavin <[EMAIL PROTECTED]>**20050804021130]
[Make curl exit with error on failed downloads
[EMAIL PROTECTED]
[Bump up AC_PREREQ version to 2.59.
[EMAIL PROTECTED]
[fix for bug 463 (with new test)
Matt Lavin <[EMAIL PROTECTED]>**20050802002116]
[bump version number, since I just made a release.
David Roundy <[EMAIL PROTECTED]>**20050731190756]
[Use simpler curl_version() function to get version string.
Kannan Goundan <[EMAIL PROTECTED]>**20050322221027]
[fix documentation on --reorder-patches.
David Roundy <[EMAIL PROTECTED]>**20050731185406]
[add changelog entry for bug #224.
David Roundy <[EMAIL PROTECTED]>**20050731133942]
[fix bug when editing long comment leaves empty file.
David Roundy <[EMAIL PROTECTED]>**20050731133612]
[TAG 1.0.4pre2
David Roundy <[EMAIL PROTECTED]>**20050731121029]
Patch bundle hash:
7dfc442cacb88ca7db87670e694735612d5b3126
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFDf2GSMi+gvMn4IFIRAs0HAJ9y3ogD6F7PsSDaJsk3aTgZdD1F3wCfTTV4
LnZRkrv0Gz3XLLojYZhPyUA=
=udCQ
-----END PGP SIGNATURE-----
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel