Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] autocrlf=input with CRLF in repository does not behave like C Git

Sorry, for top-posting...

I've been using a CRLF'ed working tree on a Mac. Wish some Windows users could
test this too before release, or even before merge.

Anyway, a cherry pick failed because of this code in the ResolveMerger,

		// Worktree entry has to match ours to be considered clean
		boolean isDirty = work.isModeDifferent(modeO);
		if (!isDirty && nonTree(modeF))
			isDirty = !tw.idEqual(T_FILE, T_OURS);
		// Ignore existing empty directories

The working tree iterator declares the file clean, but then there is an additional comparing with the
id. Why is it not enough that the WTI says it's ok? The file is not included in the merge base.

-- robin

----- Ursprungligt meddelande -----
> Från: "Robin Rosenberg" <robin.rosenberg@xxxxxxxxxx>
> Till: "Robin Stocker" <robin@xxxxxxxxx>
> Kopia: "JGit Developers list" <jgit-dev@xxxxxxxxxxx>
> Skickat: måndag, 9 dec 2013 12:21:56
> Ämne: Re: [jgit-dev] autocrlf=input with CRLF in repository does not behave	like C Git
> 
> 
> 
> ----- Ursprungligt meddelande -----
> > Från: "Robin Rosenberg" <robin.rosenberg@xxxxxxxxxx>
> > Till: "Robin Stocker" <robin@xxxxxxxxx>
> > Kopia: "JGit Developers list" <jgit-dev@xxxxxxxxxxx>
> > Skickat: söndag, 8 dec 2013 12:33:28
> > Ämne: Re: [jgit-dev] autocrlf=input with CRLF in repository does not behave
> > 	like C Git
> > 
> > 
> > ----- Ursprungligt meddelande -----
> > > Från: "Robin Stocker" <robin@xxxxxxxxx>
> > > Till: "Robin Rosenberg" <robin.rosenberg@xxxxxxxxxx>
> > > Kopia: "JGit Developers list" <jgit-dev@xxxxxxxxxxx>
> > > Skickat: torsdag, 5 dec 2013 22:56:05
> > > Ämne: Re: [jgit-dev] autocrlf=input with CRLF in repository does not
> > > behave
> > > 	like C Git
> > > 
> > > Hej,
> > > 
> > > Thanks for looking into this, Robin! There's a problem with the fix,
> > > see extended test in patch set 3:
> > > 
> > > https://git.eclipse.org/r/#/c/19397/
> > 
> > ok, updated the patch. I did not investigate the exact behavior
> > further, so please take a critical view. Adding more test would
> > be helpful too.
> > 
> > One may note that JGit has a performance problem which gets
> > worse here because we do not rewrite the smudged index after
> > comparing the content. C Git does this and therefore does not
> > have to repeat this content comparison again until the file, index
> > or HEAD changes.
> 
> I was wrong there it seems, nevertheless a patch update was warranted
> to help with performance anyway.
> 
> > The issue is more  likely to hurt with autocrlf enabled since we
> > need to read the file more than once.
> > 
> > -- robin
> > 
> > 
> > > Regards,
> > >   Nibor
> > > 
> > > > I posted a patch there. I'd be nice if someone on Windows would test
> > > > it.
> > > > 
> > > > -- robin
> > > > 
> > > > ----- Ursprungligt meddelande -----
> > > > > Från: "Robin Stocker" <robin@xxxxxxxxx>
> > > > > Till: "JGit Developers list" <jgit-dev@xxxxxxxxxxx>
> > > > > Skickat: torsdag, 5 dec 2013 15:15:47
> > > > > Ämne: [jgit-dev] autocrlf=input with CRLF in repository does not
> > > > > behave	like C Git
> > > > > 
> > > > > Hey,
> > > > > 
> > > > > In the last few days, I've had several developers complain to me
> > > > > about this, and I suspect that e.g. EGit is losing users because
> > > > > of this.
> > > > > 
> > > > > The problem: When there are files in the repository that use CRLF,
> > > > > and the user has "core.autocrlf" set to "input", all these files
> > > > > are detected as modified (in IndexDiff).
> > > > > 
> > > > > C Git behaves as expected and does not show any changes.
> > > > > 
> > > > > Here's the bug report about this, with a failing test case:
> > > > > 
> > > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=372834
> > > > > 
> > > > > I would really appreciate it if someone familiar with the
> > > > > DirCacheEntry code could take a look.
> > > > > 
> > > > > Cheers,
> > > > >   Robin Stocker
> > > > > _______________________________________________
> > > > > jgit-dev mailing list
> > > > > jgit-dev@xxxxxxxxxxx
> > > > > https://dev.eclipse.org/mailman/listinfo/jgit-dev
> > > > > 
> > > > 
> > > 
> > _______________________________________________
> > jgit-dev mailing list
> > jgit-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/jgit-dev
> > 
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jgit-dev
> 


Back to the top