git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How to rewrite author history

From
Jeff King <peff@peff.net>
Date
Mar 22, 2008, 16:57 UTC
Message-ID
<20080322165737.GB7611@coredump.intra.peff.net>
In-Reply-To
<216e54900803220611v5aa5e9d5q86da249480be3c91@mail.gmail.com>
On Sat, Mar 22, 2008 at 06:11:12AM -0700, Andrew Arnott wrote:
Show 7 quoted lines
> git-filter-branch --env-filter '
> [...]
> And I did this for master, and my v1 and v0.1 branches.  I'm concerned
> though, that since I changed the names of all the objects by doing
> this, did I somehow make my branches incompatible with each other?
> Will there be any problems in the future sharing commits or merging
> across branches as a result?

There are two concerns, and I'm not sure which you have (I think number 1):

  1. Your branches within the repository will not connect anymore. I
     believe this is a non-issue with your filter, since the generated
     commit IDs are deterministic. Certainly a toy case worked for me
     with:
       for i in master branch; do
         git filter-branch --env-filter=... $i
       done
     You can also specify both to be done at the same time, which is
     more efficient:
       git filter-branch --env-filter=... master branch
     You can check the graph structure with "gitk master branch" which
     should show them connecting.
  2. Your branches are now a different, rewritten history compared to
     anyone who has cloned or fetched from you. This is unavoidable, and
     the answer is either "don't use filter-branch" or "tell everyone to
     rebase their work on the new history." So the best time to
     filter-branch is right after import, but before you start work.
-Peff
Previous: Andrew ArnottNext: Andrew Arnott
Message 5 of 7 in “Re: How to rewrite author history”
  1. Andrew ArnottMar 21, 2008
  2. Dmitry PotapovMar 21, 2008
  3. Samuel TardieuMar 22, 2008
  4. Andrew ArnottMar 22, 2008
  5. Jeff KingMar 22, 2008
  6. Andrew ArnottMar 22, 2008
  7. Jeff KingMar 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.