kind marker in status should be optional and or check isatty()

Bug #112390 reported by James Troup
6
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
Martin von Gagern

Bug Description

I often want to commit a subset of files, which are all trivially grepable by name, and do things like:

  bzr commit -m "FOO BAZ OIDENTD" $(bzr st | grep oidentd)

which is great, except when there are symlinks in the status output. It'd be nice if bzr status' ls -F-isms could be disabled, either by a command line option or because the code did an isatty() check before turning them on (as ls does).

Related branches

John A Meinel (jameinel)
Changed in bzr:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Thanks for the report.

In this particular case you can do

 bzr commit -m FOO $(bzr ls |grep oidentd)

this will pick up some unmodifed files, but commit should happily ignore them.

Switching on isatty can be confusing for people trying to write scripts so we're a bit reluctant to make that the only way to control things.

In a discussion on the list there was some suggestion that adding an option 'bzr ls --modified' would be the best way to generate a list of files for a case like this.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 112390] Re: kind marker in status should be optional and or check isatty()

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Martin Pool wrote:

> Switching on isatty can be confusing for people trying to write scripts
> so we're a bit reluctant to make that the only way to control things.

It is worse than that. isatty does not indicate whether the results are
being used interactively.

"bzr status" and "bzr status | less" should have the same output format,
but isatty will return False in the second case.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGQORS0F+nu1YWqI0RAqfiAJ9Ryq/GPczRNdYXI7zTvv+w2DQVygCeKD0o
erMpLehspBqzfYBAcZOovLA=
=aEcB
-----END PGP SIGNATURE-----

Revision history for this message
James Troup (elmo) wrote : Re: [Bug 112390] Re: kind marker in status should be optional and or check isatty()

Martin Pool <email address hidden> writes:

> In a discussion on the list there was some suggestion that adding an
> option 'bzr ls --modified' would be the best way to generate a list
> of files for a case like this.

bzr ls --modified, if it existed, would indeed fix my use case. bzr
ls as it stands isn't overly useful since it lists directories which
makes it hard to exclude files a level or two down.

--
James

Revision history for this message
wouter bolsterlee (wbolster) wrote :

What about this:

  bzr commit $(bzr modified |grep foo)

Revision history for this message
Bubba Siggler (bud3) wrote :

Hi all,

I was reading the 112390 bug and was not able to define isatty.

John spoke earlier on it being on the wish list.

best regards

bubba

On 5/18/07, Wouter Bolsterlee (uws) <email address hidden> wrote:
>
> What about this:
>
> bzr commit $(bzr modified |grep foo)
>
> --
> kind marker in status should be optional and or check isatty()
> https://bugs.launchpad.net/bugs/112390
> You received this bug notification because you are a member of Bazaar
> Developers, which is the registrant for Bazaar.
>

--
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFkcN7yXWcajQQndYRAgbqAKCMyXN9Jx4g0X7jocg+aUSFz0x4LwCgrURW
eGtqLjpzQVYa9+gzpCRtB84=
=zrpM
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote :

bug 213172 also notes that parsing this output is also a problem for emacs.

Maybe we should put the symlink/executable flag at the start of the line, or in a separate field, rather than after the filename?

Changed in bzr:
importance: Wishlist → Medium
Revision history for this message
Martin Pool (mbp) wrote :

See also bug 46636

Revision history for this message
Glenn Morris (rgm+lp) wrote :

I tagged this "affects-emacs", hope this is OK. It is explained in bug 213172 that the presence
of the "@" makes it hard to parse the status output. For a specific example of a problem, caused by this,
see Emacs bug report http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6724.

tags: added: affects-emacs
Revision history for this message
Vincent Ladeuil (vila) wrote :

>>>>> Glenn Morris <email address hidden> writes:

    > I tagged this "affects-emacs", hope this is OK.

It certainly is, thanks for bringing it to our attention.

    > It is explained in bug 213172 that the presence of the "@" makes
    > it hard to parse the status output. For a specific example of a
    > problem, caused by this, see Emacs bug report
    > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6724.

Right, in that case it's either:
- we add an option for [*@] to not be added,
- emacs use bzrlib.

While the later would be better, nobody is working on it, so adding an
option is certainly the way to go.

tags: added: easy
Jelmer Vernooij (jelmer)
Changed in bzr:
status: Confirmed → Fix Released
assignee: nobody → Martin von Gagern (gagern)
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.