Provide a "shelf" command as an extended shelve --list

Bug #643420 reported by Glen Mailer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

It would be useful to be able to obtain more information about the changes on the shelf, but this is quite tricky to add such options into the existing "shelve --list"

It would be nice to have a "bzr shelf" command, which has output somewhat like "bzr log", including the same behaviour for -v and -p.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 643420] [NEW] Provide a "shelf" command as an extened shelve --list

Glen Mailer пишет:
> It would be useful to be able to obtain more information about the
> changes on the shelf, but this is quite tricky to add such options into
> the existing "shelve --list"
>
> It would be nice to have a "bzr shelf" command, which has output
> somewhat like "bzr log", including the same behaviour for -v and -p.

You can use `bzr unshelve --dry-run` and `bzr unshelve --preview` for
that. No need for the new command.

Do you think this is underdocumented?

--
All the dude wanted was his rug back

Revision history for this message
Glen Mailer (glenjamin) wrote : Re: Provide a "shelf" command as an extened shelve --list

I'd say the way that viewing / exploring the list is split between two commands is not particularly user friendly.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 643420] Re: Provide a "shelf" command as an extened shelve --list

Glen Mailer пишет:
> I'd say the way that viewing / exploring the list is split between two
> commands is not particularly user friendly.

So, you think that adding 3rd command will help to improve user interface?

--
All the dude wanted was his rug back

Revision history for this message
Glen Mailer (glenjamin) wrote : Re: Provide a "shelf" command as an extened shelve --list

> So, you think that adding 3rd command will help to improve user interface?

Yes, that's why I reported this bug.

There are 3 distinct actions involved when working with shelved changes:

* Shelving some changes
* Applying previously shelved changes
* Viewing and examining items "on the shelf"

It seems very counter-intuitive to me that if I want to see details about a shelved change, I use the "unshelve" command.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 643420] Re: Provide a "shelf" command as an extened shelve --list

Glen Mailer пишет:
>> So, you think that adding 3rd command will help to improve user
> interface?
>
> Yes, that's why I reported this bug.
>
> There are 3 distinct actions involved when working with shelved changes:
>
> * Shelving some changes
> * Applying previously shelved changes
> * Viewing and examining items "on the shelf"
>
>
> It seems very counter-intuitive to me that if I want to see details about a shelved change, I use the "unshelve" command.

OK, so you suggest to extract shelve --list, unshelve --dry-run and
unshelve --preview into separate command. Do you have in mind any
suggestions regarding name of that command and options for the new command?

--
All the dude wanted was his rug back

Revision history for this message
Glen Mailer (glenjamin) wrote : Re: Provide a "shelf" command as an extened shelve --list

I was in favour of "bzr shelf" since we're looking at the shelf itself, although this may have some historical issues with the old bzrtools version.

I envisage the output to be somewhat similar to "bzr log", currently "bzr shelve --list" is similar to "bzr log --short" without the dates.
The two outputs i'd like to see - the list of changes and the diff of changes are available in "bzr log" using the -p and -v flags, it probably makes sense to include the date a change was shelved in the output too.

Purpose: Show the list of shelved changes
Usage: bzr shelf

Options:
  -v, --verbose Show files changed in each shelved change.
  -q, --quiet Only display errors and warnings.
  -p, --show-diff Show changes made in each shelved change as a patch.
  --forward Show from oldest to newest.
  -l N, --limit=N Limit the output to the first N shelved changes.
  --usage Show usage message and options.
  --timezone=ARG Display timezone as local, original, or utc.
  -h, --help Show help message.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 643420] Re: Provide a "shelf" command as an extened shelve --list

Glen Mailer пишет:
>> So, you think that adding 3rd command will help to improve user
> interface?
>
> Yes, that's why I reported this bug.
>
> There are 3 distinct actions involved when working with shelved changes:
>
> * Shelving some changes
> * Applying previously shelved changes
> * Viewing and examining items "on the shelf"
>
>
> It seems very counter-intuitive to me that if I want to see details about a shelved change, I use the "unshelve" command.

Actually, neither `unshelve --dry-run` nor `unshelve --preview` show you
the items "on the shelf". Both commands show you the possible result of
applying shelved changes.

Look at this example:

C:\Temp\6>bzr init

C:\Temp\6>echo foo > foo

C:\Temp\6>bzr add
added foo

C:\Temp\6>bzr commit -m1
Committing to: C:/Temp/6/
modified foo
Committed revision 1.

C:\Temp\6>echo spam > foo

C:\Temp\6>bzr st
modified:
   foo

C:\Temp\6>bzr shelve -m test --all
Selected changes:
  M foo
Changes shelved with id "1".

C:\Temp\6>bzr shelve --list
   1: test

C:\Temp\6>bzr unshelve --dry-run
Using changes with id "1".
Message: test
  M foo

C:\Temp\6>bzr unshelve --preview
Using changes with id "1".
Message: test
  M foo
=== modified file 'foo'
--- a/foo 2010-09-20 14:15:06 +0000
+++ b/foo 2010-09-20 14:15:24 +0000
@@ -1,1 +1,1 @@
-foo
+spam

C:\Temp\6>bzr unshelve --keep
Using changes with id "1".
Message: test
  M foo
All changes applied successfully.

C:\Temp\6>bzr shelve --list
   1: test

C:\Temp\6>bzr unshelve --dry-run
Using changes with id "1".
Message: test

C:\Temp\6>bzr unshelve --preview
Using changes with id "1".
Message: test

C:\Temp\6>

As you can see after `unshelve --keep` the changes still present in the
shelf, but they're also applied to the working tree. So both `unshelve
--fry-run` and `unshelve --preview` show there is no changes to apply.

Vincent Ladeuil (vila)
Changed in bzr:
status: New → Confirmed
Revision history for this message
Vincent Ladeuil (vila) wrote : Re: Provide a "shelf" command as an extened shelve --list

I'm unclear about *where* some 'shelve status' should be provided, but I like the idea of being able to get a summary of what a shelf is with a bit more details than what --list provides.

May be '-v' would be enough (bar the usual objections about overloading '-v' for so many commands).

The shelf message is not always enough when visiting very old shelves, while the complete diff is too much.

Changed in bzr:
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
tags: added: shelf
Revision history for this message
Vincent Ladeuil (vila) wrote :

See also bug #995717 'Getting the original diff with bzr unshelve is hard'.

summary: - Provide a "shelf" command as an extened shelve --list
+ Provide a "shelf" command as an extended shelve --list
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.