Re: [PATCH 1/2] relative_path should honor dos_drive_prefix

2013-09-12 Thread Tvangeste
Thank you, this fixes the problem with `git svn rebase` on Windows for me.

--Tvangeste

On Thu, Sep 12, 2013 at 11:12 AM, Jiang Xin worldhello@gmail.com wrote:
 Tvangeste found that the relative_path function could not work
 properly on Windows if in and prefix have dos driver prefix.
 ($gmane/234434)

 e.g., When execute: test-path-utils relative_path C:/a/b D:/x/y,
 should return C:/a/b, but returns ../../C:/a/b, which is wrong.

 So make relative_path honor dos_drive_prefix, and add test cases
 for it in t0060.

 Reported-by: Tvangeste i.4m.l...@yandex.ru
 Helped-by: Johannes Sixt j...@kdbg.org
 Signed-off-by: Jiang Xin worldhello@gmail.com
 ---
  path.c| 20 
  t/t0060-path-utils.sh |  4 
  2 files changed, 24 insertions(+)

 diff --git a/path.c b/path.c
 index 7f3324a..ffcdea1 100644
 --- a/path.c
 +++ b/path.c
 @@ -441,6 +441,16 @@ int adjust_shared_perm(const char *path)
 return 0;
  }

 +static int have_same_root(const char *path1, const char *path2)
 +{
 +   int is_abs1, is_abs2;
 +
 +   is_abs1 = is_absolute_path(path1);
 +   is_abs2 = is_absolute_path(path2);
 +   return (is_abs1  is_abs2  !strncasecmp(path1, path2, 1)) ||
 +  (!is_abs1  !is_abs2);
 +}
 +
  /*
   * Give path as relative to prefix.
   *
 @@ -461,6 +471,16 @@ const char *relative_path(const char *in, const char 
 *prefix,
 else if (!prefix_len)
 return in;

 +   if (have_same_root(in, prefix)) {
 +   /* bypass dos_drive, for c: is identical to C: */
 +   if (has_dos_drive_prefix(in)) {
 +   i = 2;
 +   j = 2;
 +   }
 +   } else {
 +   return in;
 +   }
 +
 while (i  prefix_len  j  in_len  prefix[i] == in[j]) {
 if (is_dir_sep(prefix[i])) {
 while (is_dir_sep(prefix[i]))
 diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh
 index 76c7792..c3c3b33 100755
 --- a/t/t0060-path-utils.sh
 +++ b/t/t0060-path-utils.sh
 @@ -208,6 +208,10 @@ relative_path a/b/ a/b ./
  relative_path aa/b ../
  relative_path x/y  a/b ../../x/y
  relative_path a/c  a/b ../c
 +relative_path a/b  /x/ya/b
 +relative_path /a/b x/y /a/bPOSIX
 +relative_path d:/a/b   D:/a/c  ../bMINGW
 +relative_path C:/a/b   D:/a/c  C:/a/b  MINGW
  relative_path a/b  empty   a/b
  relative_path a/b  nulla/b
  relative_path empty/a/b./
 --
 1.8.3.rc2.14.g5ac1b82

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Regression in e02ca72: git svn rebase is broken on Windows

2013-09-10 Thread Tvangeste
Hi,

After bisecting this problem I ended up with the mentioned commit that 
completely breaks git-svn for me on Windows (mingw/msys version).

==
# git svn rebase
warning: unable to access '': Invalid argument
warning: unable to access '': Invalid argument
fatal: unable to access '../../../../w:/work/my/repo.git/.git/config': Invalid 
argument
fatal: index file open failed: Invalid argument
Cannot rebase: You have unstaged changes.
Please commit or stash them.
rebase refs/remotes/trunk: command returned error: 1
==

Please note that I use the official git repository as-is, this one (no 
additional patches):
git://git.kernel.org/pub/scm/git/git.git

e02ca72f70ed8f0268a81f72cb3230c72e538e77 is the first bad commit
commit e02ca72f70ed8f0268a81f72cb3230c72e538e77
Author: Jiang Xin
Date:   Tue Jun 25 23:53:43 2013 +0800

path.c: refactor relative_path(), not only strip prefix

Thanks,
  --Tvangeste
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Regression in e02ca72: git svn rebase is broken on Windows

2013-09-10 Thread Tvangeste
10.09.2013, 18:13, Johannes Schindelin johannes.schinde...@gmx.de:
 Have you tried with Git for Windows yet?

What's Git for Windows? If you mean msysgit, then I say no, because the latest 
msysgit version is from June 02, and the change under discussion was made later 
on, on June 25th. So, this regression is not in msysgit release (yet).

Thanks,
  --Tvangeste
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Regression in e02ca72: git svn rebase is broken on Windows

2013-09-10 Thread Tvangeste
10.09.2013, 18:53, Johannes Sixt j...@kdbg.org:
 Can you please run the command with GIT_TRACE=2?

Sure:
# git --version
trace: built-in: git 'version'
git version 1.8.4.242.gbb80ee0

# git svn rebase -l
trace: exec: 'git-svn' 'rebase' '-l'
trace: run_command: 'git-svn' 'rebase' '-l'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--show-cdup'
trace: built-in: git 'config' '--bool' '--get' 'svn.fetchall'
trace: built-in: git 'config' '--bool' '--get' 'svn.noauthcache'
trace: built-in: git 'config' '--bool' '--get' 'svn.nocheckout'
trace: built-in: git 'config' '--get' 'svn.authorsprog'
trace: built-in: git 'config' '--bool' '--get' 'svn.dryrun'
trace: built-in: git 'config' '--bool' '--get' 'svn.preservemerges'
trace: built-in: git 'config' '--bool' '--get' 'svn.followparent'
trace: built-in: git 'config' '--bool' '--get' 'svn.useSvmProps'
trace: built-in: git 'config' '--get' 'svn.authorsfile'
trace: built-in: git 'config' '--get' 'svn.username'
trace: built-in: git 'config' '--get' 'svn.repackflags'
trace: built-in: git 'config' '--bool' '--get' 'svn.localtime'
trace: built-in: git 'config' '--int' '--get' 'svn.repack'
trace: built-in: git 'config' '--get' 'svn.ignorepaths'
trace: built-in: git 'config' '--bool' '--get' 'svn.verbose'
trace: built-in: git 'config' '--bool' '--get' 'svn.quiet'
trace: built-in: git 'config' '--int' '--get' 'svn.logwindowsize'
trace: built-in: git 'config' '--get' 'svn.ignorerefs'
trace: built-in: git 'config' '--get' 'svn.configdir'
trace: built-in: git 'config' '--bool' '--get' 'svn.merge'
trace: built-in: git 'config' '--bool' '--get' 'svn.addauthorfrom'
trace: built-in: git 'config' '--bool' '--get' 'svn.useSvnsyncProps'
trace: built-in: git 'config' '--bool' '--get' 'svn.noMetadata'
trace: built-in: git 'config' '--bool' '--get' 'svn.local'
trace: built-in: git 'config' '--get' 'svn.strategy'
trace: built-in: git 'config' '--get' 'svn.includepaths'
trace: built-in: git 'config' '--bool' '--get' 'svn.uselogauthor'
trace: built-in: git 'rev-parse' '--symbolic' '--all'
trace: built-in: git 'config' '-l'
trace: built-in: git 'config' '-l'
trace: built-in: git 'update-index' '--refresh'
trace: built-in: git 'rev-list' '--first-parent' '--pretty=medium' 'HEAD' '--'
trace: built-in: git 'config' '--bool' 'svn.useSvmProps'
trace: built-in: git 'config' '-l'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'for-each-ref' '--format=%(refname)' 'refs/'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteRoot'
trace: built-in: git 'config' '--get' 'svn-remote.svn.url'
trace: built-in: git 'config' '--get' 'svn-remote.svn.pushurl'
trace: built-in: git 'config' '--get' 'svn-remote.svn.uuid'
trace: built-in: git 'rev-list' '--pretty=raw' '--reverse' 
'cdc459d7cedcec6bb26812e24661c7318f031be4..refs/remotes/trunk' '--'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteRoot'
trace: built-in: git 'config' '--get' 'svn-remote.svn.rewriteUUID'
trace: built-in: git 'diff-index' 'HEAD' '--'
trace: exec: 'git-rebase' 'refs/remotes/trunk'
trace: run_command: 'git-rebase' 'refs/remotes/trunk'
trace: built-in: git 'rev-parse' '--parseopt' '--' 'refs/remotes/trunk'
trace: built-in: git 'rev-parse' '--git-dir'
trace: built-in: git 'rev-parse' '--is-bare-repository'
trace: built-in: git 'rev-parse' '--show-toplevel'
trace: built-in: git 'config' '--bool' 'rebase.stat'
trace: built-in: git 'config' '--bool' 'rebase.autostash'
trace: built-in: git 'config' '--bool' 'rebase.autosquash'
trace: built-in: git 'rev-parse' '--verify' 'refs/remotes/trunk^0'
trace: built-in: git 'rev-parse' '--verify' 'refs/remotes/trunk^0'
trace: built-in: git 'symbolic-ref' '-q' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'rev-parse' '--verify' 'HEAD'
trace: built-in: git 'update-index' '-q' '--ignore-submodules' '--refresh'
fatal: unable to access 
'../../../../w:/work/xxx/xxx-xxx-OSS.git.new/.git/config': Invalid argument
trace: built-in: git 'diff-files' '--quiet' '--ignore-submodules'
fatal: index file open failed: Invalid argument
Cannot rebase: You have unstaged changes.
trace: built-in: git 'diff-index' '--cached' '--quiet' '--ignore-submodules' 
'HEAD' '--'
Please commit or stash them.
rebase refs/remotes/trunk: command returned error: 1

Thanks,
  --Tvangeste
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Regression in e02ca72: git svn rebase is broken on Windows

2013-09-10 Thread Tvangeste
10.09.2013, 20:02, Johannes Schindelin johannes.schinde...@gmx.de:
  Given the explanation what msysGit is, you might suspect that I'd like you
  to try to fix this in the msysGit context: After installing

  https://code.google.com/p/msysgit/downloads/list?q=net+installer

No problem. Here's what I have so far:

1. Installed the latest msysgit from the URL you've provided. Tried the git 
that comes out of the box that comes with the installer (1.8.3.msysgit):

1a. On CMD: everything is fine.
1b. On msys shell: everything is fine.

2. Checked out the branch you've suggested to try (pt/tentative-1.8.4) and 
installed it. Tried the new version:

2a. On CMD: got the problem that is being discussed in this thread.
2b. On msys shell: everything is fine.

So, in summary. That commit e02ca72, somewhere between 1.8.3 and 1.8.4 
introduced the regression in git/git-svn on Windows, when executed in CMD.

Thanks,
  --Tvangeste
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH master] convert: The native line-ending is \r\n on MinGW

2013-08-13 Thread Tvangeste
Brice Lambson bricelam at live.com writes:
 +1, this is a significant issue downstream in Git for Windows:
 
 https://github.com/msysgit/git/issues/57
 
 Effectively this renders .gitattributes useless for the scenario of 
 enforcing normalized line ending characters.

+100

Folks, the problem is still there, with the very latest Git built with MinGW 
on Windows. Having eol=native in gitattributes means *LF* EOLs on 
Windows/MinGW.

So, essentially, eol=native is completely broken. And this is the most useful 
option to put into gitattributes and share among those working on the project.

Currently, I have to put eol=crlf there, and that means that those working on 
Linux will end up with CRLF files in their working copies.

The link quoted above does contain an additional fix that resolves the 
problem.

Thanks,
  --Tvangeste

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html