Multi-line commit message in Windows?

Adrian Wilkins adrian.wilkins at gmail.com
Mon Jan 26 10:50:13 GMT 2009


I've been using Powershell for windows, which seems to cope with
multi-line entry just fine.

21# $a = "Spam,
>> Spam,
>> Eggs and
>> Spam"
>>
22# echo $a
Spam,
Spam,
Eggs and
Spam
23#

But on trying this on Bazaar, I found only the first line was being used
in the log comment.

This seems to be a deficiency of the DOS command interpreter (cmd.exe)
and not the Windows console per-se... for my Python-flavoured install,
Powershell is invoking the "bzr.bat" file in the scripts folder ; this
starts up an instance of cmd.exe just to run the batch file and is
probably the reason it's being trimmed.

Instead if you add a Powershell script (bzr.ps1) to the scripts folder,
this takes precedence on the PoSH PATH, so you can do multi-line
messages at the command line. I'd imagine the exe-flavoured version just
works properly from PoSH.

# bzr.ps1
c:\Python25\Python.exe c:\Python25\Scripts\bzr $args

I seriously recommend PoSH to anyone using Bazaar on Windows - it's just
a nicer shell than cmd.exe all around ; I prefer it to bash as well
(possibly because my bash skills are not well-developed), although
sometimes the friction between GNU-style utils and PoSH can be a pain
until you work out the way around it. bash is probably still more
powerful but for me involves a great deal more headscratching to achieve
similar results.

e.g.

# Remove all unknown files from your tree (execute from root of tree)
bzr ls --unknown | rm


# Combined with PoSH's ability to treat XML like first-class objects

# Grab the log in forward order
$log = [xml](bzr log --forward --xml)

# Do something for each tag
$log.logs.log | foreach {
  if($_.tags.tag -ne $null) {
    $_.tags.tag | foreach {
      # make a release tarball or something
    }
  }
}





More information about the bazaar mailing list