Re: [git-users] Merge conflicts in files with no difference in file compare

2016-04-12 Thread Konstantin Khomoutov
On Thu, 7 Apr 2016 05:05:05 -0700 (PDT)
Konrád Lőrinczi  wrote:

First, sorry for the late reply.

> I have two branches and I would like to merge them.
> I have merge conflicts in more thousand files, but most of these have
> no difference in file compare.

What exactly is "file compare"?

Please note that comparing files managed by Git may be tricky due to
possible effects of EOL "normalization".  The issue here is that if you
perform "normal" checkout of a file from the Git database Git will
apply EOL conversions as configured.  I'm also not sure that
`git show :path/to/file` does not perform such conversions
even though its documentation uses the word "raw" when discusses this
mode.

Hence, to verify, I'd resort to using `git ls-tree [-r]` and then
`git cat-file blob ` after figuring out what blob you'd like
to check from the output of the previous command: AFAIK `git cat-file`
by default has any text conversion turned off.

[...]
> There might to be two kind of problems here:
> 1) DOS & Unix linefeed differences
> 2) file permissions are different
> 
> 
> There are thousand of files, so doing this merge conflict solving one
> by one is a nightmare.
> 
> Question: 
> - Is there a solution to fix permissions to 755 for directories and
> 644 for files automatically?

That's a red herring: while Git indeed records "file mode bits"
it does not actually store permission bits.  What it stores, is to tell
files (always 0644) from directories (always 0755) and symlinks (don't
remember).  As an exception, it stores the executable bit as well.

No owner UID and GID values are stored; no POSIX (or whatever) ACLs are
stored.

The solution would amount to scripting around the `find` and `chmod`
programs, like, say

find . -type d -print0 | xargs -0 -n 30 chmod 0755
find . -type f -print0 | xargs -0 -n 30 chmod 0644

> - Is there a solution to convert linefeeds from DOS to Unix for files 
> automatically?

It's a complicated topic.

If you mean Git's own solution, then in theory you might prepare a
suitable .gitattrubutes file (or .git/info/attributes) which would
force certain EOL style for certain kinds of files and then perform
forced checkout -- to have some consistent state in the work tree,
and then possibly forced adding of all the files to the index and
committing -- to have the files normalized in a certain way in the
repository.

> - Is there any way to do these fixes for the initial commit? (Because
> I would like to connect two separate branches one over other using
> fast forward merge).

Well, yes, that's what `git filter-branch` is for.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Merge conflicts in files with no difference in file compare

2016-04-07 Thread Konrád Lőrinczi
I have two branches and I would like to merge them.
I have merge conflicts in more thousand files, but most of these have no 
difference in file compare.
I'm using Windows 7 Pro with Git Extensions to work locally, repo server is 
Debian 8.
- Debian 8 git version: 2.6.0
- Windows 7 git version: 2.6.3.windows.1


There might to be two kind of problems here:
1) DOS & Unix linefeed differences
2) file permissions are different


There are thousand of files, so doing this merge conflict solving one by 
one is a nightmare.

Question: 
- Is there a solution to fix permissions to 755 for directories and 644 for 
files automatically?
- Is there a solution to convert linefeeds from DOS to Unix for files 
automatically?
- Is there any way to do these fixes for the initial commit? (Because I 
would like to connect two separate branches one over other using fast 
forward merge).



Thanks your advices,
Konrad

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.