Having issues with stow not ignoring the .git folder on MacOS

Rafael Bermúdez <[email protected]> Thu, 8 Aug 2024 17:42:10 -0300
Newsgroups gmane.comp.gnu.stow.general
Message-ID <CADt7pp0VM2f3oteJJ3ZmLo-7aGVfTb8_MkuTPZ0r1OWpeadFdA@mail.gmail.com>
--000000000000b76452061f3211aa
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi there. First of all, thanks for this mailing list and the software
itself. I do appreciate it very much.

I am a new stow user (started using it a few days ago), and I am having a
hard time understanding why it is not ignoring the .git folder in my root
directory.

It is my understanding that it should be ignored by default, but it does
not seem to be the case on my MacBook (MacBook Pro M1 Pro, Sonoma 14.6.1,
stow version is GNU Stow 2.4.0, obtained through homebrew formulae, if this
matters at all).

This is how my root directory structure looks like:

=E2=9D=AF tree -d -a
.
=E2=94=9C=E2=94=80=E2=94=80 .git
=E2=94=82  =E2=94=9C=E2=94=80=E2=94=80 hooks
=E2=94=82  =E2=94=9C=E2=94=80=E2=94=80 info
...
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 tags
=E2=94=9C=E2=94=80=E2=94=80 alacritty
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 alacritty
=E2=94=9C=E2=94=80=E2=94=80 fsh
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 fsh
=E2=94=9C=E2=94=80=E2=94=80 git
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 git
=E2=94=9C=E2=94=80=E2=94=80 k9s
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 k9s
=E2=94=82          =E2=94=94=E2=94=80=E2=94=80 skins
=E2=94=9C=E2=94=80=E2=94=80 tmux
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 tmux
=E2=94=94=E2=94=80=E2=94=80 zsh
    =E2=94=94=E2=94=80=E2=94=80 .config
        =E2=94=9C=E2=94=80=E2=94=80 p10k
        =E2=94=94=E2=94=80=E2=94=80 zsh

This is how I am invoking stow (dry run and verbose for debugging): stow -n
-v -t ~ */, and this is the output:

=E2=9D=AF stow -n -v -t ~ */
LINK: COMMIT_EDITMSG =3D> dev/repos/personal/dotfiles/.git/COMMIT_EDITMSG
LINK: FETCH_HEAD =3D> dev/repos/personal/dotfiles/.git/FETCH_HEAD
LINK: HEAD =3D> dev/repos/personal/dotfiles/.git/HEAD
LINK: ORIG_HEAD =3D> dev/repos/personal/dotfiles/.git/ORIG_HEAD
LINK: config =3D> dev/repos/personal/dotfiles/.git/config
LINK: description =3D> dev/repos/personal/dotfiles/.git/description
LINK: hooks =3D> dev/repos/personal/dotfiles/.git/hooks
LINK: index =3D> dev/repos/personal/dotfiles/.git/index
LINK: info =3D> dev/repos/personal/dotfiles/.git/info
LINK: logs =3D> dev/repos/personal/dotfiles/.git/logs
LINK: objects =3D> dev/repos/personal/dotfiles/.git/objects
LINK: packed-refs =3D> dev/repos/personal/dotfiles/.git/packed-refs
LINK: refs =3D> dev/repos/personal/dotfiles/.git/refs
LINK: .config/alacritty =3D>
../dev/repos/personal/dotfiles/alacritty/.config/alacritty
LINK: .config/fsh =3D> ../dev/repos/personal/dotfiles/fsh/.config/fsh
LINK: .config/git =3D> ../dev/repos/personal/dotfiles/git/.config/git
LINK: .config/tmux =3D> ../dev/repos/personal/dotfiles/tmux/.config/tmux
LINK: .config/p10k =3D> ../dev/repos/personal/dotfiles/zsh/.config/p10k
LINK: .config/zsh =3D> ../dev/repos/personal/dotfiles/zsh/.config/zsh
LINK: .zshrc =3D> dev/repos/personal/dotfiles/zsh/.zshrc
WARNING: in simulation mode so not modifying filesystem.

As you can see, the  .git folder is being included on the symlinks.

I attempted to add a .stow-global-ignore in my home folder and a
.stow-local-ignore file in the stow root directory (with \.git, /\.git,
\.git/, .git, and other combinations) to no avail.

I thought that invoking stow with */ makes it so *every* package  is
stowed, even the .git folder, but then I went out and tried the exactly
same configuration in an Ubuntu VM and it works fine:

=E2=9D=AF stow --simulate --verbose --target ~ */
LINK: .config =3D> dev/repos/personal/dotfiles/alacritty/.config
UNLINK: .config (reverts previous action)
MKDIR: .config
LINK: .config/alacritty =3D>
../dev/repos/personal/dotfiles/alacritty/.config/alacritty
LINK: .config/fsh =3D> ../dev/repos/personal/dotfiles/fsh/.config/fsh
LINK: .config/k9s =3D> ../dev/repos/personal/dotfiles/k9s/.config/k9s
LINK: .config/p10k =3D> ../dev/repos/personal/dotfiles/p10k/.config/p10k
LINK: .config/tmux =3D> ../dev/repos/personal/dotfiles/tmux/.config/tmux
LINK: .config/zsh =3D> ../dev/repos/personal/dotfiles/zsh/.config/zsh
LINK: .zshrc =3D> dev/repos/personal/dotfiles/zsh/.zshrc
WARNING: in simulation mode so not modifying filesystem.

I feel I am doing something wrong, but I cannot figure out what it is. From
what I have read, it *should *work the same in both OSs.

Is there any way I can troubleshoot this?

Any help would be greatly appreciated!

Thanks a lot,
Rafael

--000000000000b76452061f3211aa
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div>
<p>Hi there. First of all, thanks for this mailing list and the software it=
self. I do appreciate it very much.<br></p><p>I am a new=20
<code>stow</code>=20

user (started using it a few days ago), and I am having a hard time underst=
anding why it is not ignoring the <code>.git</code> folder in my root direc=
tory.<br></p>

<p>It is my understanding that it should be ignored by default, but it=20
does not seem to be the case on my MacBook (MacBook Pro M1 Pro, Sonoma 14.6=
.1,=20
<code>stow</code>=20

version is GNU Stow 2.4.0, obtained through homebrew formulae, if this matt=
ers at all).<br></p><p></p>

<p>This is how my root directory structure looks like:</p>

<pre><code>=E2=9D=AF tree -d -a
.
=E2=94=9C=E2=94=80=E2=94=80 .git
=E2=94=82  =E2=94=9C=E2=94=80=E2=94=80 hooks
=E2=94=82  =E2=94=9C=E2=94=80=E2=94=80 info
...
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 tags
=E2=94=9C=E2=94=80=E2=94=80 alacritty
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 alacritty
=E2=94=9C=E2=94=80=E2=94=80 fsh
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 fsh
=E2=94=9C=E2=94=80=E2=94=80 git
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 git
=E2=94=9C=E2=94=80=E2=94=80 k9s
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 k9s
=E2=94=82          =E2=94=94=E2=94=80=E2=94=80 skins
=E2=94=9C=E2=94=80=E2=94=80 tmux
=E2=94=82  =E2=94=94=E2=94=80=E2=94=80 .config
=E2=94=82      =E2=94=94=E2=94=80=E2=94=80 tmux
=E2=94=94=E2=94=80=E2=94=80 zsh
    =E2=94=94=E2=94=80=E2=94=80 .config
        =E2=94=9C=E2=94=80=E2=94=80 p10k
        =E2=94=94=E2=94=80=E2=94=80 zsh
</code></pre>

<p>This is how I am invoking stow (dry run and verbose for debugging): <cod=
e>stow -n -v -t ~ */</code>, and this is the output:</p>

<pre><code>=E2=9D=AF stow -n -v -t ~ */
LINK: COMMIT_EDITMSG =3D&gt; dev/repos/personal/dotfiles/.git/COMMIT_EDITMS=
G
LINK: FETCH_HEAD =3D&gt; dev/repos/personal/dotfiles/.git/FETCH_HEAD
LINK: HEAD =3D&gt; dev/repos/personal/dotfiles/.git/HEAD
LINK: ORIG_HEAD =3D&gt; dev/repos/personal/dotfiles/.git/ORIG_HEAD
LINK: config =3D&gt; dev/repos/personal/dotfiles/.git/config
LINK: description =3D&gt; dev/repos/personal/dotfiles/.git/description
LINK: hooks =3D&gt; dev/repos/personal/dotfiles/.git/hooks
LINK: index =3D&gt; dev/repos/personal/dotfiles/.git/index
LINK: info =3D&gt; dev/repos/personal/dotfiles/.git/info
LINK: logs =3D&gt; dev/repos/personal/dotfiles/.git/logs
LINK: objects =3D&gt; dev/repos/personal/dotfiles/.git/objects
LINK: packed-refs =3D&gt; dev/repos/personal/dotfiles/.git/packed-refs
LINK: refs =3D&gt; dev/repos/personal/dotfiles/.git/refs
LINK: .config/alacritty =3D&gt; ../dev/repos/personal/dotfiles/alacritty/.c=
onfig/alacritty
LINK: .config/fsh =3D&gt; ../dev/repos/personal/dotfiles/fsh/.config/fsh
LINK: .config/git =3D&gt; ../dev/repos/personal/dotfiles/git/.config/git
LINK: .config/tmux =3D&gt; ../dev/repos/personal/dotfiles/tmux/.config/tmux
LINK: .config/p10k =3D&gt; ../dev/repos/personal/dotfiles/zsh/.config/p10k
LINK: .config/zsh =3D&gt; ../dev/repos/personal/dotfiles/zsh/.config/zsh
LINK: .zshrc =3D&gt; dev/repos/personal/dotfiles/zsh/.zshrc
WARNING: in simulation mode so not modifying filesystem.
</code></pre>

<p>As you can see, the=C2=A0
<code>.git</code> folder is being included on the symlinks.=C2=A0</p><p>I a=
ttempted to add a <code>.stow-global-ignore</code> in my home folder and a =
<code>.stow-local-ignore</code> file in the stow root directory (with  <cod=
e>\.git</code>, <code>/\.git</code>, <code>\.git/</code>, <code>.git</code>=
, and other combinations) to no avail.</p>

<p>I thought that invoking stow with <code>*/</code> makes it so <em>every<=
/em> package=C2=A0 is stowed, even the
<code>.git</code> folder, but then I went out and tried the exactly same co=
nfiguration in an Ubuntu VM and it works fine:</p><p>
</p><pre><code>=E2=9D=AF </code>stow --simulate --verbose --target ~ */<br>=
LINK: .config =3D&gt; dev/repos/personal/dotfiles/alacritty/.config<br>UNLI=
NK: .config (reverts previous action)<br>MKDIR: .config<br>LINK: .config/al=
acritty =3D&gt; ../dev/repos/personal/dotfiles/alacritty/.config/alacritty<=
br>LINK: .config/fsh =3D&gt; ../dev/repos/personal/dotfiles/fsh/.config/fsh=
<br>LINK: .config/k9s =3D&gt; ../dev/repos/personal/dotfiles/k9s/.config/k9=
s<br>LINK: .config/p10k =3D&gt; ../dev/repos/personal/dotfiles/p10k/.config=
/p10k<br>LINK: .config/tmux =3D&gt; ../dev/repos/personal/dotfiles/tmux/.co=
nfig/tmux<br>LINK: .config/zsh =3D&gt; ../dev/repos/personal/dotfiles/zsh/.=
config/zsh<br>LINK: .zshrc =3D&gt; dev/repos/personal/dotfiles/zsh/.zshrc<b=
r>WARNING: in simulation mode so not modifying filesystem.</pre>

<p>I feel I am doing something wrong, but I cannot figure out what it is. F=
rom what I have read, it <i>should </i>work the same in both OSs.<br></p><p=
>Is there any way I can troubleshoot this?=C2=A0</p><p>Any help would be gr=
eatly appreciated!</p>

<br clear=3D"all"></div>Thanks a lot,<br></div>Rafael<br></div>

--000000000000b76452061f3211aa--