Skip to content

Commit

Permalink
Fix backdating of tags
Browse files Browse the repository at this point in the history
This probably never worked:
 * There was a typo in GIT_COMMITTER_DATE
 * export'd environment is local to the shell and doesn't stick around
 * And if it did, this would break any later commits

$ for x in broken fixed; \
  do cd test.$x; \
  ts=$(git cat-file tag 0.1 | sed -e '/^tagger/!d;s/^.*> \([^ ]*\).*$/\1/'); \
  ruby -e 'puts "'$x':\t" + Time.at('$ts').strftime("%Y-%m-%d")'; \
  cd ..; \
done
broken: 2009-05-06
fixed:  2009-02-16
  • Loading branch information
mss authored and nirvdrum committed Jun 9, 2009
1 parent 577e908 commit 172df08
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/svn2git/migration.rb
Expand Up @@ -125,8 +125,7 @@ def fix_tags
id = tag.strip.gsub(%r{^#{@options[:tags]}\/}, '')
subject = `git log -1 --pretty=format:"%s" #{tag.strip()}`
date = `git log -1 --pretty=format:"%ci" #{tag.strip()}`
`export GIT_COMMITER_DATE="#{date}"`
run_command("git tag -a -m '#{subject}' '#{id.strip()}' '#{tag.strip()}'")
run_command("GIT_COMMITTER_DATE='#{date}' git tag -a -m '#{subject}' '#{id.strip()}' '#{tag.strip()}'")
run_command("git branch -d -r #{tag.strip()}")
end
end
Expand Down

0 comments on commit 172df08

Please sign in to comment.