RE: git filter-branch re-write history over a range of commits did notwork
From: LU Chuck <hidden>
Date: 2019-05-28 09:59:58
-----Original Message----- From: Johannes Sixt <redacted> Sent: Tuesday, May 28, 2019 2:22 AM To: LU Chuck <redacted> 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:quoted
Hi team, The issue comes fromhttps://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 = .quoted
I want to re-write history by filter-branch command over a range ofcommits, but the command did not work.quoted
I have referred to the following three documentation about how to use gitfilter-branch:quoted
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=quoted
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=s_git-2Dfilter-2Dbranch&d=DwICaQ&c=O17m6UdqOAIZh9XQ8pTl4g&r=VcGeIeOZ _8quoted
_zlrQNSboenYltfxGNIXN_qG6VpZgXVRk&m=PCS1M1ifdx6sA8TMCp7ScKA3-HjUf AajePquoted
ZfGnQ-94o&s=tWbrczoPb11Ywr7Y7HPO8-LaXWhbqrE4q6iyrCabNsk&e= You can reproduce the problem by the following steps 1. clone the repositoryhttps://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=quoted
2. checkout to the temp branch 3. run the command git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' ... 67d9d9..f70bf4Did 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] Let's move back here, I know what three dots does now. According this documentation https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-Theem82308203emthree-dotSymmetricDifferenceNotation . Then the command I need to run is git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"' 67d9d9..f70bf4 But why I got the error message " You must specify a ref to rewrite. ". When I use command " git log 67d9d9..f70bf4 ", it will list 4 commits. It means the commits range works. So, the problem would be, why the git filter-branch could not recognized 67d9d9..f70bf4 as a range of commits?
quoted
4. You will got the info "Found nothing to rewrite" However, it was supposed to overwrite the history from commit 9c1580 tocommit f70bf4, make the commit date same as date.quoted
I am not sure if I am using the filter-branch correctly, or if there is a bug ingit?quoted
Anyone can help me? Thanks in advance.-- Hannes