empty arguments lost in EDITOR

Bug #1089792 reported by Ross Lagerwall
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Ross Lagerwall
2.5
Fix Released
High
Ross Lagerwall

Bug Description

I have my EDITOR='emacsclient -a "" -t'.

When it comes to commit, bzr does not invoke the editor correctly. It invokes it as 'emacsclient -a "-t"'.

To reproduce this, first create a simple script which shows the arguments given to it:
$ cat - > /tmp/args
#!/usr/bin/python2

import sys

for i in sys.argv:
    print "'%s'" % i
EOF

$ chmod +x /tmp/args
$ export EDITOR='/tmp/args -a "" -t'
$ bzr commit
Committing to: /tmp/repo/
...
'/tmp/args'
'-a'
'-t'
'/tmp/bzr_log.O8navN'

You can see that the arguments are incorrect, it should be something like:
Committing to: /tmp/repo/
...
'/tmp/args'
'-a'
''
'-t'
'/tmp/bzr_log.O8navN'

Related branches

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Which version of bzr are you running? Here's what I get when I try the test case:
rwilbur@ordinate:~/src/bzr_test$ bzr status
added:
  args
rwilbur@ordinate:~/src/bzr_test$ export EDITOR='/home/rwilbur/src/bzr_test/args -a "" -t'
rwilbur@ordinate:~/src/bzr_test$ printf "%s\n" $EDITOR
/home/rwilbur/src/bzr_test/args
-a
""
-t
rwilbur@ordinate:~/src/bzr_test$ bzr commit
Committing to: /home/rwilbur/src/bzr_test/
added args
'/home/rwilbur/src/bzr_test/args'
'-a'
'""'
'-t'
'bzr_log.8Edb8D'
aborting commit write group: BzrCommandError(empty commit message specified)
bzr: ERROR: empty commit message specified
rwilbur@ordinate:~/src/bzr_test$ bzr --version
Bazaar (bzr) 2.1.4

Revision history for this message
Ross Lagerwall (rosslagerwall) wrote : Re: [Bug 1089792] Re: bzr invokes incorrect command

$ bzr --version
Bazaar (bzr) 2.5.1
  Python interpreter: /usr/bin/python2 2.7.3
  Python standard library: /usr/lib/python2.7
  Platform: Linux-3.6.9-1-ARCH-x86_64-with-glibc2.2.5
  bzrlib: /usr/lib/python2.7/site-packages/bzrlib
  Bazaar configuration: /home/ross/.config/bazaar
  Bazaar log file: /home/ross/.bzr.log

Copyright 2005-2012 Canonical Ltd.
http://bazaar.canonical.com/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

---
Perhaps this bug was introduced since then?

Revision history for this message
Richard Wilbur (richard-wilbur) wrote : Re: bzr invokes incorrect command

I think:
 1. You're right, it looks like a regression somewhere between 2.1.4 and 2.5.1! Good catch.
 2. Maybe I need to update my dusty bzr install on this machine. Of course it is running Ubuntu 10.04 LTS (which is still supported till April 2013).

I guess I need to jump on a machine with a newer version of bzr so I can reproduce this bug. (Tomorrow)

Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Reproduced on my Ubuntu 12.04 LTS install which provides bzr 2.5.1.

Changed in bzr:
status: New → Confirmed
milestone: none → 2.5.2
milestone: 2.5.2 → 2.6b3
importance: Undecided → High
status: Confirmed → Triaged
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Seems we should target this fix to HEAD and 2.5.2, at least, since you discovered it in 2.5.1. I tried to select two milestones as targets and I'm not sure what became of that.

Ross do you want this bug assigned to you since you created the fix?

Changed in bzr:
assignee: nobody → Ross Lagerwall (rosslagerwall)
Revision history for this message
Richard Wilbur (richard-wilbur) wrote :

Looks like the regression was introduced between 2.2.4 and 2.5.1, which narrows the field slightly.

Tested with the following results on bzr 2.2.4 under Ubuntu 10.10 (seems to work correctly):

rwilbur@conjugate:/tmp/repo$ export EDITOR='/tmp/repo/args -a "" -t'
rwilbur@conjugate:/tmp/repo$ bzr commit
Committing to: /tmp/repo/
added args
'/tmp/repo/args'
'-a'
'""'
'-t'
'bzr_log.TJb3jF'
Commit message was not edited, use anyway? [y/n]: n
aborting commit write group: BzrCommandError(empty commit message specified)
bzr: ERROR: empty commit message specified
rwilbur@conjugate:/tmp/repo$ bzr --version
Bazaar (bzr) 2.2.4
  Python interpreter: /usr/bin/python 2.6.6
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.35-32-generic-x86_64-with-Ubuntu-10.10-maverick
  bzrlib: /usr/lib/python2.6/dist-packages/bzrlib
  Bazaar configuration: /home/rwilbur/.bazaar
  Bazaar log file: /home/rwilbur/.bzr.log

Copyright 2005-2010 Canonical Ltd.
http://bazaar.canonical.com/

Vincent Ladeuil (vila)
summary: - bzr invokes incorrect command
+ empty arguments lost in EDITOR
Vincent Ladeuil (vila)
Changed in bzr:
status: Triaged → Fix Released
Vincent Ladeuil (vila)
Changed in bzr:
milestone: 2.6b3 → 2.6.0
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.