|
From: Daniel J S. <dan...@ie...> - 2017-11-16 21:36:51
|
On 11/16/2017 03:14 PM, Ethan A Merritt wrote: > On Thursday, November 16, 2017 12:50:06 PM PST Daniel J Sebald wrote: >> On 11/16/2017 02:07 PM, Ethan A Merritt wrote: > >>> The remaining issue is incorrectly converted timestamp and author attribution. >>> I found a script that automates a recipe that is basically >>> >>> [from StackOverflow] >> >> What is the link, so we may see the context? > > https://stackoverflow.com/questions/3042437/change-commit-author-at-one-specific-commit/30737248 > >>> %%%%%%%% >>> Assume for clarity of exposition that 03f482d6 is the commit >>> whose author we are trying to replace, and 42627abe is the commit >>> with the new author. >>> >>> Checkout the commit we are trying to modify. >>> git checkout 03f482d6 >>> >>> Make the author change. >>> git commit --amend --author "New Author Name <New Author Email>" >>> >>> Replace the old commit with the new one locally. >>> git replace 03f482d6 42627abe >>> >>> Rewrite all future commits based on the replacement. >>> git filter-branch -- --all >>> >>> Remove the replacement for cleanliness. >>> git replace -d 03f482d6 >>> >>> Push the new history (only use --force if the below fails, and only after >>> sanity checking with git log and/or git diff). >>> git push --force-with-lease >>> %%%%%%%%% >>> >>> However I tried using this recipe to make one change and it failed. >>> The filter-branch step spit out progress updates for about half an hour >>> and then died. Repository too large or too complicated? >>> Some issue with branch structure that is non-fatal form most purposes >>> but trips up this specific operation? >>> Whatever, it doesn't work. >> >> That doesn't seem like something one would typically want to do in a >> functioning git repo. > > 1) This is not typical > 2) This is not [yet] a functioning git repo > > We're looking for procedures to set up a git repository in the first > instance so that it contains a "history" of transactions that actually > happened somewhere else in a foreign language subject to faulty > translation. OK, so it's not as simple as changing some text in the blob.dat file, but instead there should be some extra commits put in place? git checkout 03f482d6 git commit --amend --author "New Author Name <New Author Email>" I don't think the above works the way you are thinking. --amend only applies to the most recent change, or possibly tip of a branch. That link above is suggesting something like the following: say there is E D C B A commits. If I take the recent changes and temporarily rebase them (i.e., disconnect) to some indefinite location E D C B A I can then treat B as though it is the most recent commit and apply the familiar --amend step. There needs to be that disconnect before --amend can be applied. The "git rebase -i B" is some funky interactive command that sequentially steps through changesets to allow altering a series of changesets. Dan |