This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Checking out source code with git svn

0

For a while I could check out the source code with git svn, but now it doesn't work anymore. The command I used:

git svn clone -s http://anonsvn.wireshark.org/wireshark/trunk/ .

My computer shows some activities in CPU load, HDD, and even network traffic. But then after about 5 minutes it's just quit without any files downloaded after showing:

Initialized empty Git repository in /home/dev/workspace/wireshark/.git/
Using higher level of URL: http://anonsvn.wireshark.org/wireshark/trunk => http://anonsvn.wireshark.org/wireshark

The process /usr/lib/git-core/git-svn was running during that 5 minutes with quite a high CPU load.

Could anyone help?

asked 04 Sep '11, 00:26

francesc's gravatar image

francesc
1114
accept rate: 100%

2

Wireshark svn does not use standard layout, so I think you you should skip the '-s' option.

(05 Sep '11, 12:17) stig ♦

If you haven't already, place your vote (for Git) at Should we migrate to a different SCM?. :)

(06 Sep '11, 11:55) bstn

Can you try cloning from http://code.wireshark.org/git/wireshark ? It seems to work fine so far but I'd like to hear from more testers before making it official.

(06 Sep '11, 12:26) Gerald Combs ♦♦

It seems to work (I haven't tried building this):

c:\sandbox>git clone --depth 1 http://code.wireshark.org/git/wireshark wireshark

Cloning into wireshark… remote: Counting objects: 44136, done. remote: Compressing objects: 100% (23237/23237), done. remote: Total 44136 (delta 37889), reused 25015 (delta 20741) Receiving objects: 100% (44136/44136), 65.52 MiB | 328 KiB/s, done. Resolving deltas: 100% (37889/37889), done.

(06 Sep ‘11, 12:54) bstn

Under Ubuntu 11.04, 2.6.38-11-generic-pae, and git version 1.7.4.1 it works fine.

~/workspace/tmp2$ git clone –depth 1 http://code.wireshark.org/git/wireshark . Cloning into …. remote: Counting objects: 44131, done. remote: Compressing objects: 100% (23235/23235), done. remote: Total 44131 (delta 37884), reused 25012 (delta 20738) Receiving objects: 100% (44131/44131), 65.47 MiB | 472 KiB/s, done. Resolving deltas: 100% (37884/37884), done.

Builded and run correctly.

(06 Sep ‘11, 13:21) francesc

@Gerald, Any particular reason not to use a public git host like github (just curious)?

(06 Sep ‘11, 16:16) helloworld
showing 5 of 6 show 1 more comments


3 Answers:

0

I think you you should skip the '-s' option.

You're right, it works like a charm. Thanks a lot.

Cheers,

answered 06 Sep '11, 00:19

francesc's gravatar image

francesc
1114
accept rate: 100%

edited 06 Sep '11, 00:34

1

Try:

git svn init http://anonsvn.wireshark.org/wireshark/trunk/
git svn fetch

This will give you the full history of the repository, so will take some time, took me a little over 5 hours when svn HEAD was at r38891.

answered 06 Sep '11, 00:19

Code%20Buddy's gravatar image

Code Buddy
161
accept rate: 0%

This works either, but I believe it has the same effect as using clone in term of the history. I used the one suggested from Stig, and it also took approximately 5h until finished.

(06 Sep '11, 00:40) francesc
1

It's only taking that long because you're downloading every branch and release (unnecessarily). You only need to download the HEAD revision. You can determine that rev by:

a. Manually looking at the rev number of trunk from http://anonsvn.wireshark.org/viewvc/.

OR

b. Using svn-info and awk to query the latest rev of trunk:

$ svn info http://anonsvn.wireshark.org/wireshark/trunk/ | awk '/Revision:/ { print $2 }'
(06 Sep '11, 11:51) bstn

If the latest rev was 38900 and you wanted to download it to a local directory named "wireshark", you would use the -r parameter of git-svn like this:

$ git svn clone -r38900 http://anonsvn.wireshark.org/wireshark/trunk/ wireshark

(*NIX): Here's a bash one-liner that downloads the latest rev automatically (note the backticks):

$ git svn clone -r`svn info http://anonsvn.wireshark.org/wireshark/trunk/ | awk '/Revision:/ { print $2 }'` http://anonsvn.wireshark.org/wireshark/trunk/ wireshark
(06 Sep '11, 11:51) bstn

It's only taking that long because you're downloading every branch and release (unnecessarily).

I don't think we downloaded all branches and releases as we specified to clone/fetch the trunk only, and "gitk --all" showed only the master branch. This took so much time because of the number of commits alone. Downloading all branches might take more than a day until finished.

The command you suggested is indeed very fast, one might use it to quickly build wireshark. But for developing, I'd like to have the entire history of the trunk.

(06 Sep '11, 15:00) francesc

Ah, my mistake.

How does having the entire history help you?

(07 Sep '11, 06:59) bstn

It helps me a lot indeed. I'm always interested how someone implemented a certain feature in the past that might help me implementing a related feature. This way, I can also see which components are related with the feature and thus it makes me aware of possible conflicts.

(07 Sep '11, 07:26) francesc
showing 5 of 6 show 1 more comments

0

Use git repository origin http://code.wireshark.org/git/wireshark (fetch)

answered 07 Sep '11, 03:02

Andrei%20Emeltchenko's gravatar image

Andrei Emelt...
11
accept rate: 0%

As Gerald's comment above indicates, this isn't yet official.

(07 Sep '11, 04:43) grahamb ♦