]> git.alsa-project.org Git - alsa.git/commitdiff
alsatool - add remove command to easy remove GIT commits
authorJaroslav Kysela <perex@perex.cz>
Fri, 30 May 2008 16:31:04 +0000 (18:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 30 May 2008 16:31:04 +0000 (18:31 +0200)
alsatool

index 8944471ab30c6f3774931b7c3742b22b0cdba825..eedbc7cba3752d305b7cf4990ae9b0e00e4c0b59 100755 (executable)
--- 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, '<GIT root dir>', '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():