Ask Your Question
0

Zmena autorov commitov - git filter-branch

asked 2016-01-25 10:07:08 +0100

Lukas Nagy gravatar image

Podarilo sa Vam zmenit mena autorov a emaily pomocou postupu z prednasky?

git filter-branch --commit-filter ’
    if [ "$GIT_COMMITTER_NAME" = "<Old Name>" ];
    then
        GIT_COMMITTER_NAME="<New Name>";
        GIT_AUTHOR_NAME="<New Name>";
        GIT_COMMITTER_EMAIL="<New Email>";
        GIT_AUTHOR_EMAIL="<New Email>";
        git commit-tree "$@";
    else
        git commit-tree "$@";
    fi’ HEAD

Skusal som tam mena davat najskor z pola a for cyklom vyberat tak vsetky, avsak zobralo mi len prve dva commity kde bolo treba spravit zmenu, potom uz mena prestal menit ( prve dva commity alice -> Alice )

Vyskusal som to teda rucne po jednom, avsak vysledok ten isty. Zmena sa prejavila len v prvych dvoch commitoch od Alice, potom uz mal Petr spravny format a dalsie opravy sa nekonali.

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted
0

answered 2016-01-25 14:43:38 +0100

Lukas Nagy gravatar image

Vysledok som nakoniec dosiahol s --env-filter for cyklem kde mi rozhodoval case a skladal mi vysledne premenne.

edit flag offensive delete publish link more
0

answered 2016-01-25 13:43:45 +0100

VojtechMyslivec gravatar image

updated 2016-01-25 13:45:28 +0100

Ano, ten postup funguje. Autoru je asi pet, tak je mozne timto stylem udelat 5 vetvi if (elif) pripadne to nahradit konstrukci case.

Committer resit nemusime, proto ty dve ze ctyr promennych je mozne vynechat.

Pokud bys chtel jiny zpusob, je je mozne z puvodniho jmena autora sestrojit jmeno a e-mail ve spravnem formatu (napr. pomoci filtru).

edit flag offensive delete publish link more

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

Add answer

[hide preview]

Question tools

Follow
1 follower

Stats

Asked: 2016-01-25 10:07:08 +0100

Seen: 398 times

Last updated: Jan 25