Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7816675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T05:57:13+00:00 2026-06-02T05:57:13+00:00

I can successfully run git filter-branch on some code to e.g. merge another repo

  • 0

I can successfully run git filter-branch on some code to e.g. merge another repo into a subdirectory [1]:

git filter-branch --index-filter '
  git ls-files -s |
  perl -pe "s{\t\"?}{$&helper/}" |
    GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info &&
  mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE
' remotes/helper/master

But now, I’d also love to expand each commit’s message to include its former ID (SHA hash), since those commits may have had comments/conversation on GitHub which aren’t getting transferred over.

E.g. add an extra line like this (where bob/helpers is hardcoded/known in advance):

[COPIED FROM bob/helpers@76c7c080b3bd2f93dc78e4864899d668a57cd9f9]

As far as I can tell, Git’s msg-filter only gives me the original message, and Git’s env-filter doesn’t contain the commit ID (SHA has) as an input variable. Is this possible then, or no?

Thanks!

[1] Via this great article, with the Perl filter from this email thread to workaround a bug on Mac OS X.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T05:57:15+00:00Added an answer on June 2, 2026 at 5:57 am

    --msg-filter would be where to do it, and the original commit ID is in the environment variable $GIT_COMMIT, so (untested) make the message filter simply: cat; echo "[COPIED FROM bob/helpers@$GIT_COMMIT]".

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Symptom: Some users cannot successfully POST, most can successfully POST. When the error occurs,
I have a Ruby script that I built in TextMate and can successfully run
i am working on windows XP . i can successfully run a system() command
Port 6379 is open on the server, and I can successfully run telnet localhost
I have a table assoc containing columns local_id, remote_id, cachedData I can successfully run
The following program can run successfully: class Simple(object): def __init__(self, name): self.name = name
I can successfully run the SSIS package from my C# App. Is there a
i can succesfully run crawl command via cygwin on windows xp. and i can
I can successfully do this: App.SomeCollection = Backbone.Collection.extend({ comparator: function( collection ){ return( collection.get(
Can anyone explain how I can successfully get my processes communicating? I find the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.