[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-stow] Directories must not be symbolic
From: |
Vivien Didelot |
Subject: |
Re: [Bug-stow] Directories must not be symbolic |
Date: |
Sun, 28 Feb 2016 19:36:09 -0500 |
User-agent: |
Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) |
Hi Adam,
Adam Spiers <address@hidden> writes:
> Hi Viven,
>
> On Fri, Dec 04, 2015 at 08:48:15PM -0500, Vivien Didelot wrote:
>> Hi,
>>
>> I'm using Stow to manage my dotfiles as packages. I basically have the
>> following Stow directory in my $HOME:
>>
>> Stow
>> ├── emacs
>> │ ├── .emacs
>> │ └── .emacs.d
>> │ └── .placeholder
>> ├── git
>> │ └── .gitconfig
>> └── mail
>> ├── bin
>> │ ├── mua
>> ├── .emacs.d
>> │ ├── notmuch-config.el
>> ├── Mail
>> │ ├── .notmuch
>> │ │ └── hooks
>> │ │ ├── post-insert
>> │ │ ├── post-new
>> │ │ └── pre-new
>> │ └── work
>> │ └── .placeholder
>> ├── .mbsyncrc
>> ├── .msmtprc
>> └── .notmuch-config
>
> Cool! I do something almost identical, except I call the stow
> directory ~/.STOW. As an aside, did you see this which I linked from
> the homepage?
>
> http://lists.gnu.org/archive/html/info-stow/2011-12/msg00000.html
I think I've seen that page before, yes.
>> The problem is that if a directory doesn't exist in the target directory
>> (here it is $HOME), Stow will create a symlink for it, instead of
>> creating a real directory.
>>
>> This is bad and unlikely to be wanted, because you may end up flooding
>> your Stow packages with unwanted files.
>>
>> For instance, emacs will add some files in ~/.emacs.d
>> (e.g. auto-save-list, elpa, ido.last), that I wish not to manage. Worst,
>> my email database synced in ~/Mail/work (about 2.3G) or the notmuch
>> database in ~/Mail/.notmuch (about 1.8G) got into my mail package.
>>
>> To workaround this issue, I remember myself to type the following
>> command from within the Stow directory to ensure each (or a single)
>> package has the required directories in the target before stowing it:
>>
>> find * -mindepth 1 -type d | sed "s,^[^/]*,$HOME," | sort -u | xargs
>> mkdir -p
>>
>> IMHO, Stow must only symlink files, and create real directories. This
>> would ensure a simple and determinist behavior, and remove the need for
>> placeholders. What do you think?
>
> That's precisely why I added the --no-folding option:
>
>
> https://www.gnu.org/software/stow/manual/html_node/Installing-Packages.html#tree%20folding
>
> https://github.com/aspiers/stow/commit/ed12c787df985896c8ba1c188af45b9fb637b017
>
> ;-) So your find pipeline is unnecessary.
Great! I tested it and indeed it removes the need for the placeholders.
> However personally I don't use --no-folding, because I want more
> fine-grained control over which directories are folded, and which
> aren't. For that I use an ugly hack, which is a separate repo I call
> "ANTIFOLD", which contains empty hidden .no-stow-folding files in
> directories where I don't want folding. I stow that repo to $HOME
> alongside the other ones, and the fact that there are two repos
> stowing to the same path causes Stow to ensure that that directory is
> unfolded (i.e. a real directory).
>
> And yes, it's on the TODO list to improve this:
>
> https://github.com/aspiers/stow/blob/master/TODO
Do people use symlinks to directory a lot? Because of the flooding issue
I mentioned, I'd imagine --no-folding to be the default behavior, and
having a --folding or more explicit --symlink-dir option to change it.
Would that be acceptable?
Thanks for your time,
-v