BUG? git status shows modified files on samba share - no core.autocrlf problem!

968 views
Skip to first unread message

BUG HUNTER

unread,
Nov 9, 2011, 8:28:19 PM11/9/11
to msysGit
Hi,

I searched the list and the bugtracker, I found only samba strings in
results related to core.autocrlf issues, but I think this one has
nothing to do with core.autocrlf - I checked with core.autocrlf beeing
true and false, no difference.

What I did:

I made a clone of a git repo inside a virtual machine (virtualbox)
with Ubuntu Lucid Lynx (10.04).

git clone git://git.moodle.org/moodle.git

Please note: this was done inside the virtual machine, so the ubuntu
10.04 git from git-core repo was used.

When I check status inside the virtual machine, I get the expected
result:

user@ubuntu:/repos/moodle$ git status
# On branch master
nothing to commit (working directory clean)

Now when I export that directory with samba and map it as a network
drive on the Windows host, this is what happens:

T:\repos\moodle>git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: filter/algebra/algebra2tex.pl
# modified: filter/tex/mimetex.darwin
# modified: filter/tex/mimetex.freebsd
# modified: filter/tex/mimetex.linux
#
no changes added to commit (use "git add" and/or "git commit -a")

Of course the files have not been changed.

Samba server has no special config settings, quite default, just added
the repo dir to export.

What might be interesting: the files git identifies as modified are
mode 755 - algebra2tex.pl beeing a perl script an the others beeing
binary executables, however I did not find any info in
http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html that
these files might appear any different in windows than on the original
linux filesystem.

git version: 1.7.6.msysgit.0

Is this a bug? any ideas?

Thank you very much for your attention!
Bughunter

Konstantin Khomoutov

unread,
Nov 10, 2011, 3:43:46 AM11/10/11
to BUG HUNTER, msysGit
On Wed, 9 Nov 2011 17:28:19 -0800 (PST)
BUG HUNTER <bughun...@googlemail.com> wrote:

[...]


> I made a clone of a git repo inside a virtual machine (virtualbox)
> with Ubuntu Lucid Lynx (10.04).

[...]


> Now when I export that directory with samba and map it as a network
> drive on the Windows host, this is what happens:
>
> T:\repos\moodle>git status
> # On branch master
> # Changes not staged for commit:
> # (use "git add <file>..." to update what will be committed)
> # (use "git checkout -- <file>..." to discard changes in working
> directory)
> #
> # modified: filter/algebra/algebra2tex.pl
> # modified: filter/tex/mimetex.darwin
> # modified: filter/tex/mimetex.freebsd
> # modified: filter/tex/mimetex.linux
> #
> no changes added to commit (use "git add" and/or "git commit -a")
>
> Of course the files have not been changed.
>
> Samba server has no special config settings, quite default, just added
> the repo dir to export.
>
> What might be interesting: the files git identifies as modified are
> mode 755 - algebra2tex.pl beeing a perl script an the others beeing
> binary executables, however I did not find any info in
> http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html that
> these files might appear any different in windows than on the original
> linux filesystem.

What happens if you run `git reset --hard`?

The idea is that the fact of modification is stated using the
information in the index. If it so happens that Ubuntu's Git and your
local msysgit happen to differ in how they manage/interpret the
enitries in the index (for instance, those executable bits), resetting
should "fix" your problem meaning the issue is identified.

On the other hand, this idea of using CIFS shares to store local Git
repos is recurring, and it is so for no apparent reason. This is not
how Git is supposed to be used. Can you explain what's wrong with
using Git the normal way--just clone the repo from the Ubuntu machine
and push local changes there, if needed?

BUG HUNTER

unread,
Nov 10, 2011, 7:51:39 AM11/10/11
to msysGit
Hi Konstantin,

thank you very much for your quick response!

> What happens if you run `git reset --hard`?

when I run 'git reset --hard' on the windows host I get this:

T:\repos\moodle>git reset --hard
HEAD is now at 735de1c weekly release 2.2dev

T:\repos\moodle>git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: filter/algebra/algebra2tex.pl
# modified: filter/tex/mimetex.darwin
# modified: filter/tex/mimetex.freebsd
# modified: filter/tex/mimetex.linux
#
no changes added to commit (use "git add" and/or "git commit -a")


BUT after this inside the linux machine I have the same alleged
change:

user@ubuntu:/repos/moodle$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: filter/algebra/algebra2tex.pl
# modified: filter/tex/mimetex.darwin
# modified: filter/tex/mimetex.freebsd
# modified: filter/tex/mimetex.linux
#
no changes added to commit (use "git add" and/or "git commit -a")


OK, I then reset git inside the VM:

user@ubuntu:/repos/moodle$ git reset --hard
Checking out files: 100% (8685/8685), done.
HEAD is now at 735de1c weekly release 2.2dev

user@ubuntu:/repos/moodle$ git status
# On branch master
nothing to commit (working directory clean)

user@ubuntu:/repos/moodle$ git --version
git version 1.7.0.4


With the samba share and msysgit after this I still get:

T:\repos\moodle>git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# modified: filter/algebra/algebra2tex.pl
# modified: filter/tex/mimetex.darwin
# modified: filter/tex/mimetex.freebsd
# modified: filter/tex/mimetex.linux
#
no changes added to commit (use "git add" and/or "git commit -a")


> On the other hand, this idea of using CIFS shares to store local Git
> repos is recurring, and it is so for no apparent reason.  This is not
> how Git is supposed to be used.  Can you explain what's wrong with
> using Git the normal way--just clone the repo from the Ubuntu machine
> and push local changes there, if needed?

I totally understand your argument - to say the truth, I am not (yet)
using git this way - it was just an occasional test, I wanted to see
what happens if I use git on a samba share to better understand if git
might be usable for a special setup I have in mind.

I am normally using git only inside linux, well, uhmm... to avoid
cross-plattform problems... :)

Regarding use-cases: despite not using git the way described above in
production, I am testing several scenarios using git as a backend for
non-technical users that absolutely do not want to be bothered with
implementation or usage details - you know, the kind of "what the hell
is a versioning system, I do not want to know, go away, I have no time
for your geek speak" - people. Letting them save their files in a git
repo via a samba share (with a daily commit via cron) might be a good
way to introduce git version control totally transparent into an
established workflow without the authors even need to know about it...
but this is just an experiment.

Also some other use-cases might be interesting in connection with
[mobile] devices that do not have local storage available.

Should I open a ticket for this, just to avoid letting it disappear
into the nothingness of not-followed cross-plattform-oddities?

BTW do you think this might be a linux filesystem issue? How to
investigate deeper into this?

Thanks for your attention,
Bughunter




Johannes Sixt

unread,
Nov 10, 2011, 2:58:39 PM11/10/11
to BUG HUNTER, msysGit

git config core.filemode false

should help. As a consequence, all *new* files will be added with mode
644 in git.

-- Hannes

Reply all
Reply to author
Forward
0 new messages