From: LU Chuck <Chuck.LU@edenred.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
"chuck.lu@qq.com" <chuck.lu@qq.com>
Subject: RE: git filter-branch re-write history over a range of commits did notwork
Date: Wed, 29 May 2019 05:15:44 +0000 [thread overview]
Message-ID: <DB7PR05MB5573AD00490304E00CF6649D8D1F0@DB7PR05MB5573.eurprd05.prod.outlook.com> (raw)
In-Reply-To: <db2dcf54-8b1c-39b1-579c-425ef158c6a1@kdbg.org>
> -----Original Message-----
> From: Johannes Sixt <j6t@kdbg.org>
> Sent: Tuesday, May 28, 2019 2:22 AM
> To: LU Chuck <Chuck.LU@edenred.com>
> Cc: git@vger.kernel.org; chuck.lu@qq.com
> Subject: Re: git filter-branch re-write history over a range of commits did notwork
>
> Am 27.05.19 um 10:01 schrieb LU Chuck:
> > Hi team,
> >
> > The issue comes from
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_git-2Dfor-2
> Dwindows_git_issues_2206&d=DwICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGe
> IeOZ_8_zlrQNSboenYltfxGNIXN_qG6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA
> 3-HjUfAajePZfGnQ-94o&s=J7vtNc6IhEcruZJBeCPJJM2XR_zC-1Z0JXmNx9k5c3s&e
> = .
> >
> > I want to re-write history by filter-branch command over a range of
> commits, but the command did not work.
> > I have referred to the following three documentation about how to use git
> filter-branch:
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__stackoverflow.com_ques
> tions_15250070_running-2Dfilter-2Dbranch-2Dover-2Da-2Drange-2Dof-2Dcom
> mits&d=DwICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGeIeOZ_8_zlrQNSboenYltf
> xGNIXN_qG6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA3-HjUfAajePZfGnQ-94o
> &s=XZTtPkEqajdcG1uDxiX0AAX7F2Raf0jcubwGTKFtqv0&e=
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__stackoverflow.com_ques
> tions_28536980_git-2Dchange-2Dcommit-2Ddate-2Dto-2Dauthor-2Ddate&d=D
> wICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGeIeOZ_8_zlrQNSboenYltfxGNIXN_q
> G6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA3-HjUfAajePZfGnQ-94o&s=6scC0
> PyREzwE67wAerVgPtdO-ng_3Q_M1Ir8sWHXmfs&e=
> >
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__git-2Dscm.com_doc
> >
> s_git-2Dfilter-2Dbranch&d=DwICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGeIeOZ
> _8
> >
> _zlrQNSboenYltfxGNIXN_qG6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA3-HjUf
> AajeP
> > ZfGnQ-94o&s=tWbrczoPb11Ywr7Y7HPO8-LaXWhbqrE4q6iyrCabNsk&e=
> >
> > You can reproduce the problem by the following steps
> > 1. clone the repository
> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_chucklu_Lee
> tCode_&d=DwICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGeIeOZ_8_zlrQNSboen
> YltfxGNIXN_qG6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA3-HjUfAajePZfGnQ-
> 94o&s=G0unMrRQroUK3eE3wu7xBIGH9NbO05ydkFYROKoIcU0&e=
> > 2. checkout to the temp branch
> > 3. run the command git filter-branch --env-filter 'export
> > GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' ... 67d9d9..f70bf4
>
> Did you not tell us everything because you write ... in this message when you cited
> the command you used, or do you say that you used ...
> literally in the command?
[LU Chuck] I find the git filter-branch can't recognize commits range commitA..commitB,
it can only recognize branchA..branchB. (branchA point to commitA, branchB point to commitB.)
And you are right, I need remove the useless ... .
So I fixed the previous command as following:
Create a new branch temp2 point to 67d9d9 and switch to temp branch(point to f70bf4), then it works.
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' temp2..temp
By the way, who can improve the documentation on https://git-scm.com/docs/git-filter-branch? Currently the demo using git filter-branch with commits range commitA..commitB.
Or anyone can make it possible to support the commit range by commitA..commitB?
>
> > 4. You will got the info "Found nothing to rewrite"
> >
> > However, it was supposed to overwrite the history from commit 9c1580 to
> commit f70bf4, make the commit date same as date.
> > I am not sure if I am using the filter-branch correctly, or if there is a bug in
> git?
> >
> > Anyone can help me? Thanks in advance.
>
> -- Hannes
next prev parent reply other threads:[~2019-05-29 5:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 8:01 git filter-branch re-write history over a range of commits did notwork LU Chuck
2019-05-27 18:21 ` Johannes Sixt
2019-05-27 20:22 ` Philip Oakley
2019-05-28 5:42 ` LU Chuck
2019-05-28 6:23 ` Johannes Sixt
2019-05-28 7:10 ` LU Chuck
2019-05-28 9:33 ` Philip Oakley
2019-05-28 9:53 ` LU Chuck
2019-05-28 9:57 ` Johannes Schindelin
2019-05-28 9:59 ` LU Chuck
2019-05-29 5:15 ` LU Chuck [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-05-27 8:11 LU Chuck
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DB7PR05MB5573AD00490304E00CF6649D8D1F0@DB7PR05MB5573.eurprd05.prod.outlook.com \
--to=chuck.lu@edenred.com \
--cc=chuck.lu@qq.com \
--cc=git@vger.kernel.org \
--cc=j6t@kdbg.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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).