darcs

Issue 1276 minor UI bugs with record --pipe

Title minor UI bugs with record --pipe
Priority bug Status wont-fix
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, drewp, jaredj, kowey, thorkilnaur, twb
Assigned To
Topics ProbablyEasy, UI

Created on 2008-12-22.07:13:46 by drewp, last changed 2009-08-27.14:29:46 by admin.

Files
File name Uploaded Type Edit Remove
draft_-resolve-issue-1276_-simple-date-spoofing_.dpatch twb, 2009-04-18.03:31:44 text/x-darcs-patch
unnamed twb, 2009-04-18.03:31:45 text/plain
Messages
msg6860 (view) Author: drewp Date: 2008-12-22.07:13:42
twb and I were both expecting to find a --date flag on the record command, which
would be used to forge a different date in the unfortunate event that one has to
recreate some patches. In my current broken-repo situation, I think I can get
away with only rerecording today's patches, so I do not need a workaround (this
time). 

I'm not aware of any uses for the patch date inside darcs, so I would guess that
it would be harmless to let the user supply a wrong one.

The desperate admin who is recreating patches may also need to spoof the
username sometimes, but I think that's already trivial so it doesn't need a flag.
msg6861 (view) Author: kowey Date: 2008-12-22.10:21:42
On Mon, Dec 22, 2008 at 07:13:47 -0000, Drew Perttula wrote:
> twb and I were both expecting to find a --date flag on the record command, which
> would be used to forge a different date in the unfortunate event that one has to
> recreate some patches. In my current broken-repo situation, I think I can get
> away with only rerecording today's patches, so I do not need a workaround (this
> time). 

Try darcs record --pipe
msg6865 (view) Author: drewp Date: 2008-12-22.19:12:44
Ah, that does work. I found two usability bugs in record:

A. darcs prints some inappropriate progress info right after asking for 
the log:

1 % darcs record --pipe
2 What is the date? 2008-12-08T14:00:00
3 Who is the author? drew
4 addfile ./newfile
5 Shall I record this change? (1/1)  [ynWsfvpxdaqjk], or ? for help: y
6 What is the patch name? test2
7 What is the log?
8 Reading pristine 0
9 Finished recording patch 'test2'

Line 8 appears right after line 7, and then the cursor goes to the 
beginning of line 8. It's not obvious at all that you're supposed to 
ignore line 8, type as much as you want, and then send an EOF.

B. Date validation is deferred until line 8:

% darcs record --pipe
What is the date? today
Who is the author? drew
addfile ./newfile
Shall I record this change? (1/1)  [ynWsfvpxdaqjk], or ? for help: y
What is the patch name? t
What is the log?
darcs: bad date: today - (line 1, column 2):
unexpected "o"

I would expect a hint on the first line, such as (formats include 
ISO8601). Then I would expect a bad date to cause darcs to either abort 
immediately or ask the question again in a loop.
msg6869 (view) Author: kowey Date: 2008-12-22.22:14:39
On Mon, Dec 22, 2008 at 11:12:52 -0800, Drew Perttula wrote:
> Ah, that does work. I found two usability bugs in record:

Thanks!  Note that darcs record --pipe is only meant to be used by
automated tools and not people.  If you feel these are still bugs,
please file them separately (sorry for the random burst of bureaucracy,
just trying to keep things trackable)

> A. darcs prints some inappropriate progress info right after asking for  
> the log:

Darcs hackers: it sounds like the fix here would be to disable progress
reporting when using --pipe

> B. Date validation is deferred until line 8:

> I would expect a hint on the first line, such as (formats include  
> ISO8601). Then I would expect a bad date to cause darcs to either abort  
> immediately or ask the question again in a loop.

Note that changing the UI here *might* be undesirable because of tools that
depend on recard --pipe
msg7715 (view) Author: twb Date: 2009-04-18.03:31:45
I needed this functionality in a hurry, so I made this patch.

Note that it just stuffs the value of $DARCS_DATE directly into the
patch -- even if its not a valid date!

I'm sending it here so that I can obliterate it from my repo, while
keeping it around for next time :-)

Sat Apr 18 13:27:57 EST 2009  Trent W. Buck <trentbuck@gmail.com>
  * DRAFT: resolve issue 1276: simple date spoofing.
Attachments
msg8363 (view) Author: kowey Date: 2009-08-23.00:22:41
Hi Drew,

Retitling.  I'm still against adding a --date flag to record, mostly out of
general knee-jerk resistance to adding new flags.

I'm going to set a wont-fix on some issues you pointed out (although thanks for
them).

I'll bet we can throw in a withoutProgress when we see the Pipe flag for (A) and
make make get_date do a seq somewhere so we get the parse error early and (B)
somehow trigger the date parser as early as possible, but I doubt this will be
very beneficial.

Patches are welcome, of course :-)
History
Date User Action Args
2008-12-22 07:13:46drewpcreate
2008-12-22 10:21:45koweysetstatus: unread -> unknown
nosy: kowey, simon, drewp, thorkilnaur, dmitry.kurochkin
messages: + msg6861
2008-12-22 19:12:47drewpsetnosy: kowey, simon, drewp, thorkilnaur, dmitry.kurochkin
messages: + msg6865
2008-12-22 22:14:42koweysetnosy: kowey, simon, drewp, thorkilnaur, dmitry.kurochkin
messages: + msg6869
2008-12-26 13:07:30twbsetnosy: + twb
2009-04-18 03:31:49twbsetfiles: + draft_-resolve-issue-1276_-simple-date-spoofing_.dpatch, unnamed
nosy: kowey, simon, twb, drewp, thorkilnaur, dmitry.kurochkin
messages: + msg7715
2009-08-23 00:22:47koweysetstatus: unknown -> wont-fix
priority: wishlist -> bug
title: record should have a --date flag for spoofing dates -> minor UI bugs with record --pipe
nosy: + jaredj
messages: + msg8363
topic: + ProbablyEasy, UI
2009-08-25 17:36:37adminsetnosy: + darcs-devel, - simon
2009-08-27 14:29:46adminsetnosy: kowey, darcs-devel, twb, drewp, thorkilnaur, jaredj, dmitry.kurochkin