aspiers / aspiers/stow

.stow-local-ignore: stow does not ignore file when parent directory does not exist

Open
#91 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
1.1k
Forks
56
PR merge metrics
No merged PRs in 30d

Description

The package exhibiting the problem : https://github.com/Kraymer/F-dotfiles/tree/master/git
the file /.config/git/credentials.example should be ignored because declared in .stow-local-ignore, it is not always the case

## stowing if `~/.config/git̀` exists beforehand => `.stow-local-ignore` works as expected

~~~
$ mkdir ~/.config/git
$ stow -v5 -D git
[...]
Stowing contents of dev/F-dotfiles/git/.config/git (cwd=/home/flap)
=> ../../dev/F-dotfiles/git/.config/git
is_a_node(.config/git)
link_task_action(.config/git): no task
dir_task_action(.config/git): no task
parent_link_scheduled_for_removal(.config/git): prefix .config
parent_link_scheduled_for_removal(.config/git): prefix .config/git
parent_link_scheduled_for_removal(.config/git): returning false
is_a_node(.config/git): really exists
Using ignore file: dev/F-dotfiles/git/.stow-local-ignore
Using memoized regexps from dev/F-dotfiles/git/.stow-local-ignore
Ignore list regexp for paths: /(?^:(^|/)(.config/git/credentials.example|\.config/git/credentials.example|/.config/git/credentials.example|^/\.stow\-local\-ignore$)(/|$))/
Ignore list regexp for segments: /(?^:^(\.example)$)/
Ignoring path /.config/git/credentials.example
~~~

## stowing if `~/.config/git̀` not exists beforehand => `~/.config/git̀` is symlinked including ignored file

~~~
$ rm -rf ~/.config/git
$ stow -v5 -D git
[...]
Stowing contents of dev/F-dotfiles/git (cwd=/home/flap)
=> dev/F-dotfiles/git
is_a_node(.)
link_task_action(.): no task
dir_task_action(.): no task
parent_link_scheduled_for_removal(.): prefix
parent_link_scheduled_for_removal(.): returning false
is_a_node(.): really exists
Using ignore file: dev/F-dotfiles/git/.stow-local-ignore
Using memoized regexps from dev/F-dotfiles/git/.stow-local-ignore
Ignore list regexp for paths: /(?^:(^|/)(^/\.stow\-local\-ignore$|.config/git/credentials.example)(/|$))/
Ignore list regexp for segments: none
Not ignoring .config
~~~

Contributor guide

Open the contributing guide

Research direction

Reproduce the two stow commands with and without the existing ~/.config/git directory, using the git package and its .stow-local-ignore file. Read how the ignore list is applied when stowing the package root versus .config/git; done means credentials.example remains ignored in both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.