Opened 8 years ago

Closed 8 years ago

#4024 closed defect (fixed)

TorCtl.TorUtil.get_git_version() fails with some repos

Reported by: aagbsn Owned by: mikeperry
Priority: Low Milestone:
Component: Core Tor/Torflow Version:
Severity: Keywords:
Cc: aagbsn@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Git repo format is not consistent:

reported by arma:

INFO[Tue Sep 06 21:33:44 2011]:TorFlow Version: master 5736529160df12435fb39d11f81a5da92f74d615
NOTICE[Tue Sep 06 21:33:44 2011]:Git Repo at ../../TorCtl/.git/ Not Found

analysis from irc:

16:20:03 < armadev> bwauth@moria:~/work/torflow.git/TorCtl/.git$ cat HEAD 
16:20:03 < armadev> e99394c46b30ed73ffbf02d5c6a39bf9b04416a2
16:20:34 < aagbsn> armadev: oh, this is not what I was expecting.
16:20:52 < armadev> oh good
16:21:00 < aagbsn>  cat .git/HEAD 
16:21:01 < aagbsn> ref: refs/heads/master
16:21:18 < aagbsn> so that's the problem :)
16:21:20 < aagbsn> thanks
16:21:39 < aagbsn> what version of git are you using?
16:21:49 < armadev> git version 1.5.6.5
16:21:50 < aagbsn> (1.7.4.1)
16:21:55 < aagbsn> bah.
16:25:07 < aagbsn> hm. I wonder why it works for torflow though :)

Child Tickets

Change History (6)

comment:1 in reply to:  description Changed 8 years ago by arma

Replying to aagbsn:

16:25:07 < aagbsn> hm. I wonder why it works for torflow though :)

Presumably my TorCtl repo got checked out in a different way than my torflow repo.

bwauth@moria:~/work/torflow.git/.git$ cat HEAD 
ref: refs/heads/master

comment:2 Changed 8 years ago by aagbsn

git submodules appear to behave as follows:
"It is possible for HEAD to refer to a specific revision that is not associated with a branch name"

comment:3 Changed 8 years ago by aagbsn

Status: newneeds_review

new behavior:

>>> get_git_version('.git/')
('detached', 'ae86e31d744e24029a046033e9366343a1a5c280')
>>> 

fix here:
https://github.com/aagbsn/torctl/branches/4024-get_git_version

comment:4 Changed 8 years ago by aagbsn

Tested on my local machine with both detached head and branch:

detached head:

INFO[Wed Sep 14 17:42:37 2011]:TorFlow Version: master 67b4547a1edbdbbef283ac35709c40808619840f
INFO[Wed Sep 14 17:42:37 2011]:TorCtl Version: detached fe115ae0d0d1ae5a2fb77315ca7f33b22cead3db

branch:

INFO[Wed Sep 14 17:46:19 2011]:TorFlow Version: master 67b4547a1edbdbbef283ac35709c40808619840f
INFO[Wed Sep 14 17:46:19 2011]:TorCtl Version: 4024-get_git_version fe115ae0d0d1ae5a2fb77315ca7f33b22cead3db

comment:5 Changed 8 years ago by aagbsn

Cc: aagbsn@… added

comment:6 Changed 8 years ago by aagbsn

Resolution: fixed
Status: needs_reviewclosed
Note: See TracTickets for help on using tickets.