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

Fixes #284 and #259 #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fixes #284 and #259 #285

wants to merge 2 commits into from

Conversation

sagiru
Copy link

@sagiru sagiru commented Sep 11, 2019

There are two bugs filed at debian. This patches should fix them in a minimal and reasonable way.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905832
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=893997

git2svn sometimes parses the stdout of git commands but if the locale is
not set to something like en_US it can't and fails with the following
error:

Running command: git branch --track "<branch>" "remotes/svn/<branch>"
fatal: No se puede configurar el rastreo de información; el punto de
partida 'remotes/svn/1.0' no es una rama.
********************************************************************
svn2git warning: Tracking remote SVN branches is deprecated.
In a future release local branches will be created without tracking.
If you must resync your branches, run: svn2git --rebase
********************************************************************
Running command: git checkout "<branch>"
error: pathspec '<branch>' did not match any file(s) known to git.
command failed:
...

A comparable error for 'git config' will happend if a older version of
git (< 1.7.4) will be used.

It's never a good idea to parse messages from stdout in a special
language but this simple fix parse the messages in the same manner and
should support different languages.
The stdin bypass will use a local variable stdin instead of $stdin and
it will result in the following error:

Traceback (most recent call last):
	2: from /usr/lib/ruby/vendor_ruby/svn2git/migration.rb:432:in `block (2 levels) in run_command'
      	1: from /usr/lib/ruby/vendor_ruby/svn2git/migration.rb:432:in `loop'
/usr/lib/ruby/vendor_ruby/svn2git/migration.rb:438:in `block (3 levels) in run_command': undefined local variable or method `stdin' for #<Svn2Git::Migration:0x0000555b7c945cc8> (NameError)
Did you mean?  String

This fix should handle the error and uses the global stdin
skull-squadron added a commit to skull-squadron/svn2git that referenced this pull request Jan 14, 2024
nirvdrum#308

The proper way to do subprocess I/O is to do less.
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

Successfully merging this pull request may close these issues.

3 participants