All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wincent Colaiuta <win@wincent.com>
To: git@vger.kernel.org
Subject: (Ab)using filter-branch from a post-receive hook
Date: Sat, 14 Jul 2012 21:01:52 -0700	[thread overview]
Message-ID: <8D1AF968-AF34-4590-AB8F-E644C534A928@wincent.com> (raw)

Hi,

At $day_job we want to start publishing a subtree of our codebase as open source. As we audit and prep more sections of the code base, we'll be broadening the subtree(s) that we export, until eventually we want as close as possible to the whole thing to be open source.

The resulting public repo would only contain commits from the master branch that touch the "open" parts of the tree, so while the result wouldn't be complete or coherent, it would produce a "read-only" open source artifact and allow us to start sharing code today rather than a year or two years from now when the entire code base is audited.

I'm thinking of (ab)using filter-branch from a post-receive hook as a means to do this. Does this sound sane, or are there better options?

Specifically, I was thinking of doing the following:

- on pushing into our authoritative repo, we replicate to a second "scratch" repo where all the dirty work gets done

- the scratch repo has a master branch, and an initial "open" branch created using `git filter-branch`

- a post-receive hook in the scratch repo, given a series of commits A..B on the master branch, cherry-picks them onto the "open" branch, producing commits A'..B'

- the hook runs `git filter-branch` on the "open" branch over commits A'..B', filtering the not-yet-open parts of the tree and dropping empty commits

- the hook pushes the resulting HEAD to a public repo

Thoughts? Closest to this idea that I've been able to find online so far is [1].

Cheers,
Wincent

[1] http://stackoverflow.com/questions/2296047/repeatedly-using-git-filter-branch-to-rewrite-new-commits

             reply	other threads:[~2012-07-15  5:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-15  4:01 Wincent Colaiuta [this message]
2012-07-15  5:25 ` (Ab)using filter-branch from a post-receive hook Junio C Hamano
2012-07-15  5:50   ` Wincent Colaiuta
2012-07-15  6:44     ` Junio C Hamano
2012-07-15  8:17       ` Wincent Colaiuta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8D1AF968-AF34-4590-AB8F-E644C534A928@wincent.com \
    --to=win@wincent.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.