Stephen Leake | 4 Jul 22:25
Favicon

'i' keybinding

In diff-mode buffers, the key "i" is bound to 'dvc-pop-to-inventory',
which is (currently) only defined in tla.

What is "inventory", in tla? I wonder if it has an analog in the other
backends.

I would rather use "i" for 'ignore', which is an commonly used
operation common to all backends.

I think single-letter bindings should be reserved for commonly used
operations that are common to most backends.

--
-- Stephe
Matthieu Moy | 5 Jul 15:17
Picon
Picon
Favicon

Re: 'i' keybinding

Stephen Leake <stephen_leake <at> stephe-leake.org> writes:

> In diff-mode buffers, the key "i" is bound to 'dvc-pop-to-inventory',
> which is (currently) only defined in tla.
>
> What is "inventory", in tla? I wonder if it has an analog in the other
> backends.

This would be

  bzr ls -V
  git ls-files -t
  hg status --all

That is: show all files in the working tree, and say what is the
status of each (versionned, ignored, unknown, ...).

> I would rather use "i" for 'ignore', which is an commonly used
> operation common to all backends.

Good idea. And you need much more often to ignore a file than you need
to see the inventory (usually, "status" is what you want, it shows you
only the files you need).

The "inventory" thing can be more or less a VCS-aware file browser in
Emacs (I believe that's really similar to vc-dired).

--

-- 
Matthieu
(Continue reading)

Christian Ohler | 7 Jul 14:52
Favicon

Re: 'i' keybinding

Matthieu Moy, 2007-07-05:

> Stephen Leake <stephen_leake <at> stephe-leake.org> writes:
> 
>> In diff-mode buffers, the key "i" is bound to 'dvc-pop-to-inventory',
>> which is (currently) only defined in tla.
>>
>> What is "inventory", in tla? I wonder if it has an analog in the other
>> backends.
> 
> This would be
> 
>   bzr ls -V
>   git ls-files -t
>   hg status --all
> 
> That is: show all files in the working tree, and say what is the
> status of each (versionned, ignored, unknown, ...).

So, if the status buffer had a switch to toggle between showing all 
files and just the "interesting" files, we would no longer need a 
separate inventory mode.

>> I would rather use "i" for 'ignore', which is an commonly used
>> operation common to all backends.
> 
> Good idea. And you need much more often to ignore a file than you need
> to see the inventory (usually, "status" is what you want, it shows you
> only the files you need).

(Continue reading)

Stephen Leake | 8 Jul 01:59
Favicon

Re: 'i' keybinding

Christian Ohler <ohler+mtn <at> fastmail.net> writes:

>>> I would rather use "i" for 'ignore', which is an commonly used
>>> operation common to all backends.
>> Good idea. And you need much more often to ignore a file than you
>> need
>> to see the inventory (usually, "status" is what you want, it shows you
>> only the files you need).
>
> I'm surprised to hear that 'ignore' is used so frequently that we need
> a single letter for it.  I usually only modify .mtn-ignore a few times
> after setting up a new project to add patterns for files generated
> during build, and only rarely have to adapt it after that.

yes. Although sometimes when I add a new feature, there are new
temporary output files to ignore (most recently, table of contents in
LaTeX).

But I create new projects fairly often, and 'ignore' is useful then.

> The commands `dvc-ignore-file-extensions' and `dvc-ignore-files' are
> probably used with similar frequency, so they should be available with
> roughly the same number of keystrokes.

Yes. `dvc-ignore-file-extensions' is fairly dangerous, because it is
project-wide. So I'd put it on M-i.

I'd also like to add `dvc-ignore-file-extensions-this-directory',
which would ignore *.foo in the current file's directory. That's what
.cvsignore does, and it is handy for extensions like .pdf that are
(Continue reading)

Matthieu Moy | 7 Jul 19:08
Picon
Picon
Favicon

Re: 'i' keybinding

Christian Ohler <ohler+mtn <at> fastmail.net> writes:

> Matthieu Moy, 2007-07-05:
>
>> Stephen Leake <stephen_leake <at> stephe-leake.org> writes:
>>
>>> In diff-mode buffers, the key "i" is bound to 'dvc-pop-to-inventory',
>>> which is (currently) only defined in tla.
>>>
>>> What is "inventory", in tla? I wonder if it has an analog in the other
>>> backends.
>>
>> This would be
>>
>>   bzr ls -V
>>   git ls-files -t
>>   hg status --all
>>
>> That is: show all files in the working tree, and say what is the
>> status of each (versionned, ignored, unknown, ...).
>
> So, if the status buffer had a switch to toggle between showing all
> files and just the "interesting" files, we would no longer need a
> separate inventory mode.

Exactly. The `tla-inventory-mode' is here just because we didn't
realize that we actually needed a file-list-mode instead (which
"status" is, indeed).

>>> I would rather use "i" for 'ignore', which is an commonly used
(Continue reading)

Christian Ohler | 8 Jul 09:10
Favicon

Re: 'i' keybinding

Matthieu Moy, 2007-07-07:

> Still, there are also real-life _and_ "clean" cases where I have to
> use ignore frequently : projects which generate a lot of files, and
> which generate them within the working tree. I have this on a shared
> project with teachers, generating a lots of PDFs from LaTeX, and since
> we also have a lot of relevant .pdf files, I don't want to ignore
> *.pdf all at once.

I see.

>> (3) Add file .mtn-ignore to workspace manifest?
> 
> Indeed, since the file will show up next time you run "status", I'm
> not sure asking the question is relevant at all.

The question was useful in the absence of a proper implementation of 
xmtn-dvc-status, but since that sort of has improved, it looks like the 
question has become unnecessary, yes.

>> Maybe there should be a third ignore operation: ignore directory
>> without contents? I can't find any real use cases for this off the
>> top of my head, though.)
> 
> So, if I understand the question correctly, my answer would be "nobody
> does it this way, and no, there is no use case for it" ;-).

Good :)  (Yes, you understood the question correctly.)

Christian.
(Continue reading)

Stephen Leake | 8 Jul 01:59
Favicon

Re: 'i' keybinding

Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:

>> xmtn's implementation of both of these functions will ask between two
>> and three questions:
>> (1) Ignore %s?
>> (2) Save buffer .mtn-ignore?
>
> If the .mtn-ignore had no unsaved changes before the operation, I
> don't see any case where you would answer "yes".

Hmm. Why would you _not_ save a file? I don't see any case where you
would answer "no" to (2).

In any case, a user option to provide the default answer is easy. If
you really meant "yes" above, I guess I need to modify my option to
allow that.

>> (3) Add file .mtn-ignore to workspace manifest?
>
> Indeed, since the file will show up next time you run "status", I'm
> not sure asking the question is relevant at all.

My opinion too.

>> So even if we use a single letter for 'ignore', the entire operation
>> will currently still require 3-4 keystrokes in xmtn.  Typically,
>> question (3) will be asked only once;

Only if you say "yes". And on my machine, doing the check to see if
the file is registered takes a noticeable amount of time.
(Continue reading)

Christian Ohler | 8 Jul 09:36
Favicon

Re: 'i' keybinding

Stephen Leake, 2007-07-08:

> Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:
> 
>>> xmtn's implementation of both of these functions will ask between two
>>> and three questions:
>>> (1) Ignore %s?
>>> (2) Save buffer .mtn-ignore?
>> If the .mtn-ignore had no unsaved changes before the operation, I
>> don't see any case where you would answer "yes".
> 
> Hmm. Why would you _not_ save a file? I don't see any case where you
> would answer "no" to (2).

You want to say "no" if you already have unsaved modifications to the 
file .mtn-ignore that you still don't want to save.  If you save the 
file, the changes will affect any subsequent mtn invocation, and maybe 
you don't want that yet.

> In any case, a user option to provide the default answer is easy. If
> you really meant "yes" above, I guess I need to modify my option to
> allow that.

In this case, it looks like the right thing to do is to ask the question 
only if the file .mtn-ignore was already open and modified.  This will 
skip the question almost always, but alert the user in the cases where 
it may not be what he wants.  Do we really need an option?  I'd prefer 
to have as few options as possible; options make the space of possible 
configurations larger and can thus make the code harder to maintain.

(Continue reading)

Matthieu Moy | 8 Jul 12:00
Picon
Picon
Favicon

Re: 'i' keybinding

Christian Ohler <ohler+mtn <at> fastmail.net> writes:

> Stephen Leake, 2007-07-08:
>
>> Matthieu Moy <Matthieu.Moy <at> imag.fr> writes:
>> 
>>>> xmtn's implementation of both of these functions will ask between two
>>>> and three questions:
>>>> (1) Ignore %s?
>>>> (2) Save buffer .mtn-ignore?
>>> If the .mtn-ignore had no unsaved changes before the operation, I
>>> don't see any case where you would answer "yes".
>> 
>> Hmm. Why would you _not_ save a file? I don't see any case where you
>> would answer "no" to (2).
>
> You want to say "no" if you already have unsaved modifications to the 
> file .mtn-ignore that you still don't want to save.  If you save the 
> file, the changes will affect any subsequent mtn invocation, and maybe 
> you don't want that yet.

Indeed, if the file is open with unsaved modifications, you may even
not want Emacs/DVC to edit is (I hate automatic tools mixing with my
handwritten code). I'd do that like

(when (.mtn-ignore has unsaved modifications)
   (prompt-for-save))
(when (.mtn-ignore still has unsaved modifications)
   (abort))

(Continue reading)

Christian Ohler | 8 Jul 16:54
Favicon

Re: 'i' keybinding

Matthieu Moy, 2007-07-08:

> Indeed, if the file is open with unsaved modifications, you may even
> not want Emacs/DVC to edit is (I hate automatic tools mixing with my
> handwritten code). I'd do that like
> 
> (when (.mtn-ignore has unsaved modifications)
>    (prompt-for-save))
> (when (.mtn-ignore still has unsaved modifications)
>    (abort))
> 

The drawback of this method is that it makes it impossible to have xmtn 
make additions to the file while it has unsaved changes.

The current method, modified to skip the question if the file wasn't 
already modified, should work.  If the user was already modifying 
.mtn-ignore and doesn't like the way xmtn made its additions, he can 
simply undo.

Christian.
Matthieu Moy | 8 Jul 17:37
Picon
Picon
Favicon

Re: 'i' keybinding

Christian Ohler <ohler+mtn <at> fastmail.net> writes:

> Matthieu Moy, 2007-07-08:
>
>> Indeed, if the file is open with unsaved modifications, you may even
>> not want Emacs/DVC to edit is (I hate automatic tools mixing with my
>> handwritten code). I'd do that like
>>
>> (when (.mtn-ignore has unsaved modifications)
>>    (prompt-for-save))
>> (when (.mtn-ignore still has unsaved modifications)
>>    (abort))
>>
>
> The drawback of this method is that it makes it impossible to have
> xmtn make additions to the file while it has unsaved changes.

It does, but forces you to save before.

> The current method, modified to skip the question if the file wasn't
> already modified, should work.

For some definition of "work" only ;-). If the user doesn't want to
save the changes, the file still isn't actually ignored. I don't
really see a usefull use-case where you'd want to add something to the
ignore file without saving it.

--

-- 
Matthieu
(Continue reading)


Gmane