monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Bug #21545 -- really annoying


From: William Uther
Subject: Re: [Monotone-devel] Bug #21545 -- really annoying
Date: Fri, 23 May 2008 17:11:49 +1000


On 23/05/2008, at 4:44 PM, Richard Levitte wrote:

willu.mailingLists> Note that only when you add a directory with files
willu.mailingLists> inside it do you get the warning.  The empty
willu.mailingLists> directory 'dirB' above doesn't get a warning.
willu.mailingLists> (Currently the code doesn't look to see if all the
willu.mailingLists> files in the dir are 'ignored' - that improvment
willu.mailingLists> is left as an exercise for the reader.)  There is
willu.mailingLists> no warning if you do a recursive add.

Good idea, I like it!  However, using directory_empty() can lead to
confusion (': ; ' is my prompt):

Using ': ; ' as your prompt can lead to confusion too. :)

 : ; mkdir monotone-experiment
 : ; cd monotone-experiment/
 : ; mtn -d ../mtn.monotone-experiment db init
 : ; mtn -d ../mtn.monotone-experiment setup --branch mtn-ex .
 : ; mkdir foo
 : ; touch bar
 : ; touch foo/cookie~
: ; LANG=en_US ~/monotonework/off.net/monotone/build/mtn add -- unknown
 mtn: adding bar to workspace manifest
 mtn: adding foo to workspace manifest
mtn: warning: Non-recursive add: Files in the directory 'foo' will not be added automatically.
 : ; ls --color=no -R .
 .:
 bar  foo  _MTN

 ./foo:
 cookie~

 ./_MTN:
 format  log  options  revision  revision~
: ; LANG=en_US ~/monotonework/off.net/monotone/build/mtn add -- unknown
 mtn: skipping ignorable file foo/cookie~

Well, yes.  I noted that above:

"Currently the code doesn't look to see if all the files in the dir are 'ignored' - that improvement is left as an exercise for the reader."

The problem is that cookie~ is ignorable, and using directory_empty() doesn't pick this up. I thought about checking for non-ignorable files. But even that addition doesn't solve things because there is no way to get "--no-respect-ignore" in there, so you'll be turning the warning off even when you shouldn't.

In the end I decided that a) people do not usually add a directory with ignorable files in it and no others, and b) it is slightly better to warn slightly too much than slightly too little. :) So I left it simple and stupid.

Be well,

Will        :-}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]