Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite tags #11

Open
glensc opened this issue Apr 27, 2016 · 8 comments
Open

rewrite tags #11

glensc opened this issue Apr 27, 2016 · 8 comments

Comments

@glensc
Copy link
Contributor

glensc commented Apr 27, 2016

are you sure it rewrites tags? i.e annotated tags?

@glensc
Copy link
Contributor Author

glensc commented Apr 27, 2016

i was thinking maybe commits created with GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL env vars cause problem.

however i'm unable to reproduce the problem i'm having with real repo

➔ mkdir test
➔ cd test
➔ git init
➔ unset GIT_COMMITTER_NAME  GIT_COMMITTER_EMAIL
➔ export GIT_AUTHOR_NAME='author' GIT_AUTHOR_EMAIL='author@localhost'

➔ date > test
➔ git add test
➔ git commit -am 'test'

➔ git tag tag1
➔ git show tag1
commit 1639b75464c38b91f42c62de4abf1bc320be1b2d
Author: author <author@localhost>
Date:   Wed Apr 27 15:00:21 2016 +0300


➔ git-rewrite-author -w "author <author@localhost>" "root <root@localhost>"
Rewrite 1639b75464c38b91f42c62de4abf1bc320be1b2d (1/1) (0 seconds passed, remaining 0 predicted)    
Ref 'refs/heads/master' was rewritten
Ref 'refs/tags/tag1' was rewritten
Rewrite 2ef9d011606619b70c945531f96bd00c2379304a (1/1) (0 seconds passed, remaining 0 predicted)    
WARNING: Ref 'refs/heads/master' is unchanged
WARNING: Ref 'refs/tags/tag1' is unchanged
tag1 -> tag1 (2ef9d011606619b70c945531f96bd00c2379304a -> 2ef9d011606619b70c945531f96bd00c2379304a)

➔ git show tag1
commit 2ef9d011606619b70c945531f96bd00c2379304a
Author: root <root@localhost>
Date:   Wed Apr 27 15:00:21 2016 +0300

    test

@glensc
Copy link
Contributor Author

glensc commented Apr 27, 2016

also git rewrite-author -l doesn't even show authors from annotated tags

@glensc
Copy link
Contributor Author

glensc commented Apr 27, 2016

ok. reproduced. the reproducer requires that ~/.gitconfig does not exist.

repro.sh

➔ sh -x ../repro.sh 
+ test -d .git
+ test -f /home/glen/.gitconfig
+ unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL
+ export 'GIT_AUTHOR_NAME=author' 'GIT_AUTHOR_EMAIL=author@localhost'
+ >test 
+ date
+ git add test
+ git commit -am test
[master (root-commit) 8d9e8af] test
 Author: author <author@localhost>
 Committer: Elan Ruusamäe <[email protected]>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:

    git config --global --edit

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 1 file changed, 1 insertion(+)
 create mode 100644 test
+ export 'GIT_AUTHOR_NAME=tag author' 'GIT_AUTHOR_EMAIL=tag-author@localhost'
+ git tag -am tagged tag1
+ git show tag1
tag tag1
Tagger: Elan Ruusamäe <[email protected]>
Date:   Wed Apr 27 15:14:06 2016 +0300

tagged

commit 8d9e8af63a4a57cfa94110c9a787cfc15f631557
Author: author <author@localhost>
Date:   Wed Apr 27 15:14:06 2016 +0300

    test

diff --git a/test b/test
new file mode 100644
index 0000000..ae5d084
--- /dev/null
+++ b/test
@@ -0,0 +1 @@
+K apr   27 15:14:06 EEST 2016
+ git-rewrite-author -w 'Elan Ruusamäe <[email protected]>' 'root <root@localhost>'
Rewrite 8d9e8af63a4a57cfa94110c9a787cfc15f631557 (1/1) (0 seconds passed, remaining 0 predicted)    
WARNING: Ref 'refs/heads/master' is unchanged
WARNING: Ref 'refs/tags/tag1' is unchanged
tag1 -> tag1 (8d9e8af63a4a57cfa94110c9a787cfc15f631557 -> 8d9e8af63a4a57cfa94110c9a787cfc15f631557)
Rewrite 8d9e8af63a4a57cfa94110c9a787cfc15f631557 (1/1) (0 seconds passed, remaining 0 predicted)    
Ref 'refs/heads/master' was rewritten
Ref 'refs/tags/tag1' was rewritten
tag1 -> tag1 (8d9e8af63a4a57cfa94110c9a787cfc15f631557 -> 43b058eb2ed475dfd19e695b72b55ddfedbb6f1d)
+ git show tag1
tag tag1
Tagger: Elan Ruusamäe <[email protected]>
Date:   Wed Apr 27 15:14:06 2016 +0300

tagged

commit 43b058eb2ed475dfd19e695b72b55ddfedbb6f1d
Author: author <author@localhost>
Date:   Wed Apr 27 15:14:06 2016 +0300

    test

diff --git a/test b/test
new file mode 100644
index 0000000..ae5d084
--- /dev/null
+++ b/test
@@ -0,0 +1 @@
+K apr   27 15:14:06 EEST 2016
➔ git rewrite-author -l
The following authors and committers have contributed:

author <author@localhost>
root <root@localhost>
➔ 

@glensc
Copy link
Contributor Author

glensc commented Apr 27, 2016

i found command that shows all authors, even from annotated tags:

➔ git fast-export --no-data --all | sed -nre 's/^(author|committer|tagger) ([^>]+>).*/\2/p'|sort -u
author <author@localhost>
Elan Ruusamäe <[email protected]>
root <root@localhost>

@victornoel
Copy link

@glensc I have the same problem, it rewrite tags, but does not rewrite tags' authors!

@davidfokkema any fix for that planned?

@davidfokkema
Copy link
Owner

@victornoel Hmm. Well, I'll have to take a look. This is not as designed, of course. PR's are welcome, otherwise I'll try to make some time next week.

@victornoel
Copy link

@davidfokkema I tried to see how it could be done, but except by deleting and recreating every tags one by one, I couldn't find an elegant way to do it… but I haven't searched for long though :)

@davidfokkema
Copy link
Owner

Ok, thanks, I'll try to make some time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants