From 2e80e0204c6a85e883c9e4b33536066b1a579912 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 30 May 2008 18:31:04 +0200 Subject: [PATCH] alsatool - add remove command to easy remove GIT commits --- alsatool | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/alsatool b/alsatool index 8944471..eedbc7c 100755 --- a/alsatool +++ b/alsatool @@ -513,7 +513,7 @@ def extpick(argv, edit=False): rmtree(tmpdir) return res -def editmsg(argv): +def edit(argv, remove=False): commit = argv[0] fp = os.popen("git log --pretty=oneline --reverse %s~1..HEAD" % commit) commits = [] @@ -534,6 +534,9 @@ def editmsg(argv): raise ValueError, "git-reset" first = True for commit in commits: + if remove and first: + first = False + continue res = extpick(['.', commit], edit=first) if type(res) == type('') and res == "nochanges": print "No changes, resetting back to %s..." % head @@ -544,6 +547,9 @@ def editmsg(argv): first = False rmtree(tmpdir) +def remove(argv): + edit(argv, remove=True) + OPTS=[ ['h', 'help', usage, '', 'Print this help'], ['r', 'root', root, '', 'Set GIT root directory (default is %s)' % ROOT], @@ -559,7 +565,8 @@ CMDS=[ ['release', release, 'tag [repo]', 'Do an ALSA release (auto = automatic change control)'], ['changes', changes, 'oldtag newtag', 'Show changes between oldtag and newtag'], ['extpick', extpick, 'local-repo-path commit', 'Pick and merge a patch from another repository'], - ['edit', editmsg, 'commit', 'Edit a message for commit'] + ['edit', edit, 'commit', 'Edit a message for commit'], + ['remove', remove, 'commit', 'Remove a commit'] ] def main(): -- 2.47.1