-
Notifications
You must be signed in to change notification settings - Fork 7
/
bch
executable file
·31 lines (29 loc) · 1.22 KB
/
bch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
#
# bch - open the debian/changelog in sensible editor, appending
# a line showing the current files that have been modified
#
# Copyright (C) 2008-2010 Dustin Kirkland <[email protected]>
#
# Authors:
# Dustin Kirkland <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
msg=$(bzr diff | grep "^===" | sed -e "s:^.* file '::" -e "s:'::g" | grep -v "debian/changelog" | sort -u | xargs -i echo -n "{}, ")
msg=$(echo "$msg" | sed -e "s:, $::")
dch -a $@ "$msg: "
if [ -z "$TMUX" ]; then
exec dch -e
else
tmux new-window -n bch "bzrp diff; head -n1" \; split-window -t bch -h "dch -r && tmux kill-pane -t 0"
fi