Loading [MathJax]/extensions/tex2jax.js
Ask Your Question
0

Zmena autorov commitov - git filter-branch

asked Jan 25 '16

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.

add a comment

2 Answers

Sort by » oldest newest most voted
0

answered Jan 25 '16

Lukas Nagy gravatar image

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

link
add a comment
0

answered Jan 25 '16

VojtechMyslivec gravatar image

updated Jan 25 '16

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).

link
add a comment

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: Jan 25 '16

Seen: 398 times

Last updated: Jan 25