threads / discuss / 6947

using the same repo with different OS

Subject: using the same repo with different OS

## tl;dr

11 messages between Feb 25, 2007 and Mar 17, 2007.

replies: 10people: 4as markdown or json

Stefano Spinucci· Feb 25, 2007, 17:13 UTC · lore

I have my repos on a USB key (fat32 fs) and I work with git under linux and windows (maybe also Solaris in the future).

Considering also the new MinGW port, should I use a different repo for every OS I work with???

Are planned/expected OS-specific files in the repo preventing me to use the same whenever I'm working???

thanks in advance

--- Stefano Spinucci

Stefano Spinucci· Feb 25, 2007, 17:17 UTC · re: Stefano Spinucci · lore

Re: using the same repo with different OS

On 2/25/07, Stefano Spinucci <virgo977virgo@gmail.com> wrote:
> Are planned/expected OS-specific files in the repo preventing me to
> use the same *whenever* I'm working???
:-(
obviously, I mean "*wherever* I'm working???"

--- Stefano Spinucci

Johannes Schindelin· Feb 25, 2007, 17:34 UTC · re: Stefano Spinucci · lore

Re: using the same repo with different OS

Hi,
On Sun, 25 Feb 2007, Stefano Spinucci wrote:
Show 5 quoted lines
> I have my repos on a USB key (fat32 fs) and I work with git under
> linux and windows (maybe also Solaris in the future).
> 
> Considering also the new MinGW port, should I use a different repo for 
> every OS I work with???

You don't need to. But remember that the stat informations are likely to be borked. For example, when you do a "git-status" on a sizable working tree on that stick, it will take a long, long time whenever you switch OSes. Basically the same amount of time as if git did not have an index!

> Are planned/expected OS-specific files in the repo preventing me to use 
> the same whenever I'm working???

It could be possible that the index is saved in a slightly different format, due to different alignment strategies. Maybe 64-bit vs 32-bit has differences there. I have no idea.

Ciao, Dscho

Junio C Hamano· Feb 25, 2007, 18:20 UTC · re: Johannes Schindelin · lore

Re: using the same repo with different OS

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> It could be possible that the index is saved in a slightly different 
> format, due to different alignment strategies. Maybe 64-bit vs 32-bit has 
> differences there. I have no idea.

As far as I am aware of, there should be no such difference, although we probably rely on int being 32 and long being 64 bit. We do store our numbers in network byte order.

However, did somebody say FAT-32? I seem to recall that that filesystem lacks uid/gid, so I am reasonably sure there would be different return values for the same path from lstat(2) between git on Cygwin/MinGW and on Linux that mounts the same filesystem using vfat driver with different uid= & gid= mount options. That difference which would make the paths stat-dirty.

Also there is the problem of i-num we discussed lately. The i-num we get for the same path from lstat(2) can be different when same filesystem is mounted by different operating systems (remember that NTFS on Linux and Cygwin?).

So even though file format of the index may be designed and implemented to be portable, it might not be practical to use the same physical repository from different OSes, depending on the combination of things.

Johannes Schindelin· Feb 25, 2007, 18:30 UTC · re: Junio C Hamano · lore

Re: using the same repo with different OS

Hi,
On Sun, 25 Feb 2007, Junio C Hamano wrote:
> So even though file format of the index may be designed and implemented 
> to be portable, it might not be practical to use the same physical 
> repository from different OSes, depending on the combination of things.
Yes.

However, in the case of a _bare_ repo, which is meant purely to transport (possibly huge) changes from A to B, a USB stick can be used _without_ problems. I do that myself quite often.

Ciao, Dscho

Junio C Hamano· Feb 25, 2007, 18:35 UTC · re: Johannes Schindelin · lore

Re: using the same repo with different OS

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> However, in the case of a _bare_ repo, which is meant purely to transport 
> (possibly huge) changes from A to B, a USB stick can be used _without_ 
> problems. I do that myself quite often.

I think we are in agreement, but read the thread again. You brought up the index and my response is only about the portability of the index. Of course, the index does not matter in a bare repository ;-)

Stefano Spinucci· Feb 28, 2007, 18:06 UTC · re: Junio C Hamano · lore

Re: using the same repo with different OS

I noticed today that my notes about compiling Git on cygwin to work with FAT32 (export NO_MMAP=1) on the Wiki page WindowsInstall were removed.

Than I'm asking how you'd setup repos to work on some linux/windows machines, transferring data only with an USB disk.

* current repos scenario *
r1.linux -> on fat32
r2.windows -> on fat32
* proposed (better???) repos scenario *
r1.lin -> on ext3 (partition 1)
r1.lin -> on fat32 (partition 2) mirrored with rsync from linux
r2.win -> on fat32 (partition 2) mirrored with cwrsync from windows
r2.win -> on ntfs (partition 3)
bye, and thanks for the wonderful tool git is!

--- Stefano Spinucci

Shawn O. Pearce· Feb 28, 2007, 18:12 UTC · re: Stefano Spinucci · lore

Re: using the same repo with different OS

Stefano Spinucci <virgo977virgo@gmail.com> wrote:
> I noticed today that my notes about compiling Git on cygwin to work
> with FAT32 (export NO_MMAP=1) on the Wiki page WindowsInstall were
> removed.
That was me.  NO_MMAP=1 is now the default on Cygwin.
 
> Than I'm asking how you'd setup repos to work on some linux/windows
> machines, transferring data only with an USB disk.

Just create a bare repository on the USB stick and push/fetch to it. It won't have a checkout directory or an index, the two sticking points with mmap() on Windows and with a FAT32 filesystem being accessed through Git by both Linux and Windows.

-- 
Shawn.
Stefano Spinucci· Mar 12, 2007, 18:33 UTC · re: Shawn O. Pearce · lore

Re: using the same repo with different OS

On 2/28/07, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 9 quoted lines
>
> Stefano Spinucci <virgo977virgo@gmail.com> wrote:
> > Than I'm asking how you'd setup repos to work on some linux/windows
> > machines, transferring data only with an USB disk.
>
> Just create a bare repository on the USB stick and push/fetch to it.
> It won't have a checkout directory or an index, the two sticking
> points with mmap() on Windows and with a FAT32 filesystem being
> accessed through Git by both Linux and Windows.

Needing to have my repos backupped and only on fat32 usb keys, I was thinking to have the following layout: on usb key one --> repo.linux on usb key two --> repo.win

Then, on repo.win, I'll do: # before daily work on windows fetch from repo.linux # after daily work on windows push to repo.linux

Otherwise, on repo.linux: # before nightly work on linux fetch from repo.windows # after nightly work on linux push to repo.windows

It's possible, or I need a third bare repository between windows and linux ???
thanks

--- Stefano Spinucci

Johannes Schindelin· Mar 12, 2007, 20:05 UTC · re: Stefano Spinucci · lore

Re: using the same repo with different OS

Hi,
On Mon, 12 Mar 2007, Stefano Spinucci wrote:
Show 30 quoted lines
> On 2/28/07, Shawn O. Pearce <spearce@spearce.org> wrote:
> > 
> > Stefano Spinucci <virgo977virgo@gmail.com> wrote:
> > > Than I'm asking how you'd setup repos to work on some linux/windows
> > > machines, transferring data only with an USB disk.
> > 
> > Just create a bare repository on the USB stick and push/fetch to it.
> > It won't have a checkout directory or an index, the two sticking
> > points with mmap() on Windows and with a FAT32 filesystem being
> > accessed through Git by both Linux and Windows.
> 
> Needing to have my repos backupped and only on fat32 usb keys, I was
> thinking to have the following layout:
> on usb key one --> repo.linux
> on usb key two --> repo.win
> 
> Then, on repo.win, I'll do:
> # before daily work on windows
> fetch from repo.linux
> # after daily work on windows
> push to repo.linux
> 
> Otherwise, on repo.linux:
> # before nightly work on linux
> fetch from repo.windows
> # after nightly work on linux
> push to repo.windows
> 
> It's possible, or I need a third bare repository between windows and 
> linux ???
No need for a third one. You can even use alternates to save space:
$ git clone -l -s repo.linux repo.windows

When git-gc'ing, the objects will be packed, but if they are present in both repo.linux and repo.windows, the objects from repo.linux will be reused in repo.windows.

Note: USB sticks are almost as fragile as disks used to be... So, try 
avoiding writes if you can...

Ciao, Dscho

Stefano Spinucci· Mar 17, 2007, 14:17 UTC · re: Shawn O. Pearce · lore

Re: using the same repo with different OS

On 2/28/07, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 6 quoted lines
> Stefano Spinucci <virgo977virgo@gmail.com> wrote:
> > I noticed today that my notes about compiling Git on cygwin to work
> > with FAT32 (export NO_MMAP=1) on the Wiki page WindowsInstall were
> > removed.
>
> That was me.  NO_MMAP=1 is now the default on Cygwin.

Unfortunately, the Git cygwin mantainer decided to compile git without the NO_MMAP option (see the announcement http://cygwin.com/ml/cygwin-announce/2007-03/msg00005.html and a reply to my message http://cygwin.com/ml/cygwin/2007-03/msg00567.html).

Then, I guess if on the Wiki page WindowsInstall we should add a note about recompiling manually Git to work with FAT32.

PS

On the Git cygwin announcement, the mantainer Eric Blake said: "However, it means that this version does assume that you are not using FAT or FAT32 to hold your repositories, since they *do not store file permissions very accurately*."

What file permissions are not stored accurately ???

Shouldn't be added somewhere (maybe on the GitFaq) a note about Git on FAT32 problems (if there are any) ???

bye

--- Stefano Spinucci

← back to recent threads