On 24/03/2016 20:55, Ross Berteig wrote:

Perhaps the CLI should do more to expose the (friendly sized) SHA1 hash of both 
tech notes and wiki
pages and accept either a hash prefix or page name or time stamp to identify an 
existing note or page.

If there's no ambiguity, then the page or timestamp should also just work. If 
there is ambiguity,
then it should do something reasonable following the example of anywhere else 
ambiguity can be an
issue...


I've come to the same conclusion and I propose that:

(a) For tech notes the list command shows both the timestamp and the SHA1 hash.
(b) That for updates the DATETIME becomes DATETIME|SHA1 - i.e., you can specify either the DATETIME or its SHA1 (I believe there's no collision between the format of DATETIME and SHA1 hashes but if there is, the SHA1 would need to win). (c) The CLI permits creation of tech notes with duplicate DATETIMEs - the resulting output will need to confirm the SHA1 as well as the timestamp. (d) For edits and attachments, if DATETIME is ambiguous then the update will pick the more recently modified tech note.


Clearly if the attachment is not a technote, then it's creation at a particular 
time should not
prevent the creation of a technote with that time stamp. And vice-versa, what 
happens if you create
a technote and attach a file such that both events happen on the same second?

Whatever the answer, that is worth a test case of its own.

Agreed.


IMHO, something like this should just work:

$ T=`date "+%F %T"`
$ fossil create "Build Failed" build.stdout.txt -M text/plain -t $T
$ fossil attach build.stderr.txt -t $T

should just work even if both commands happen to execute in the same second as 
`date`.


This scenario should definitely work, it's quite close to the use case that triggered me down this route of wanting to enhance the handling of technotes!

Similarly, attaching more than one file to a single note or page should work 
too, especially when
scripted. I'm not sure what sort of trouble is implied by that claim...

Agreed - Luckily for my own usage, the relevant script already attaches several files to the tech note so I'm fairly confident it does work - that said I need to add a test for that scenario too.

--
Dave
_______________________________________________
fossil-dev mailing list
fossil-dev@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/fossil-dev

Reply via email to