nirvdrum / svn2git

Ruby tool for importing existing svn projects into git.
MIT License
2.11k stars 443 forks source link

quiet mode would be nice #21

Open cebe opened 13 years ago

cebe commented 13 years ago

Hi!

I set up a cronjob and do only want to be notified about errors. Since git prints out normal status like 'Switched to branch...' to stderr and I do not want to throw stderr output away all git commands should be called with the -q option when I want it. Feature-Request: add a -q option to svn2git that adds that -q option to all git commands.

regards, cebe

drewdeponte commented 13 years ago

Hi @cebe.

May I ask why you are using svn2git in a cron job? I am having difficulty envisioning a scenario where it makes sense to use svn2git inside cron.

The general use case for svn2git is that you have an existing SVN repository and you have decided you want to switch to Git but don't want to lose the history that you had in the SVN repository. This is normally a one time process and once it is converted you then switch over to using Git with the git repository that was generated by svn2git.

If this is the scenario you are in then why are you doing it in cron?

If this is NOT the scenario you are in please explain the scenario and I will either try to direct you to a more fitting tool or decide if the feature request is applicable for a valid use case.

Thanks, @cyphactor

cebe commented 13 years ago

I just put the command described under "Repository Updates" on https://github.com/nirvdrum/svn2git into a cronjob ;-)

drewdeponte commented 13 years ago

Ah, so you are mirroring a SVN repository to a read-only Git repository. In that case may I suggest the following modified command in your cron job to make it quiet.

cd <EXISTING_REPO> && svn2git --rebase 2>&1 > /dev/null

The above command should redact stderr (2) to stdout (1) and then redirect stdout (1) to /dev/null.

I will keep this around as a feature request since it is a nice to have. I hope the example I provided above helps you in the meantime.

cebe commented 13 years ago

thanks for your answer. I got such a workaround myself, but if I got it right, your approach suppresses all stderr output including error messages and that's not what I want. It helps not beeing spammed, but there are no errors.

drewdeponte commented 13 years ago

True if you want to just suppress stdout and leave stderr then you would just do the following:

cd <EXISTING_REPO> && svn2git --rebase > /dev/null
rpavlik commented 13 years ago

I'm doing a continuous svn to git mirror (a read-only git, that we fork on github) using Jenkins (in place of cron) and the scripts here: https://github.com/rpavlik/jenkins-svn2git

cebe commented 13 years ago

cool, thx