From 5256259f8475a8cd28b9d0ad65e348c7a2261010 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Thu, 8 Sep 2011 09:25:16 -0700 Subject: initial version --- record-original-commit.sh | 4 ++++ remove-pointless-commit.rb | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 record-original-commit.sh create mode 100755 remove-pointless-commit.rb diff --git a/record-original-commit.sh b/record-original-commit.sh new file mode 100755 index 0000000..cbb96e1 --- /dev/null +++ b/record-original-commit.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# commit message filter used with git-filter-branch to record the original commit ID +cat +echo "\nOriginally-Committed-As: $GIT_COMMIT" diff --git a/remove-pointless-commit.rb b/remove-pointless-commit.rb new file mode 100755 index 0000000..ba33522 --- /dev/null +++ b/remove-pointless-commit.rb @@ -0,0 +1,52 @@ +#!/usr/bin/ruby +# Executed like the following to trim off pointless commits (including merge commits) +# that doesn't change the tree +# git filter-branch -f --commit-filter '~/ws/jenkins/split2/helper.rb "$@"' HEAD +# +# parameters are " [ -p ]*" and is the same as git commit-tree + +# system "echo executing #{ARGV.join(' ')} >> /tmp/log" + +# extract parents +parents=[] +i=2 +while i> /tmp/log" + exec "git commit-tree #{args.join(' ')}" +else + # system "echo skipping >> /tmp/log" + # otherwise don't create this as a commit + puts parents +end + + -- cgit v1.2.3-2-g168b