bzr exit code does not depend on status-flags for files in the checkout
Bug #774446 reported by
Adam Porter
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
I put together a short script to find all bzr repos in my homedir, cd into each one, and if "bzr status" found changed files, drop into a new shell so I can diff, commit, etc. The problem is, "bzr status" returns 0 whether or not it finds changes. So this fails:
if bzr status $dir; then bash; fi
The status command should return 0 if there are changes and 1 if there are no changes.
Changed in bzr: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
tags: | added: easy status |
tags: | added: check-for-breezy |
To post a comment you must log in.
bzr returns non-zero status when a real error happens. E.g. an exception is 3, a crash is 4.
Above can be triggered on $ bzr status, for example do `bzr status /'
You should be redirecting stdout and checking that instead. There is '-V, --versioned Only show versioned files.' option if that's what you are after.
git status returns 0, if it succeeds. the exit status doesn't depend on the VCS status of the files in the repository. Instead it indicates that the program did run & return correct output and exited successfully.