Git Product home page Git Product logo

Comments (15)

eggbean avatar eggbean commented on June 5, 2024 1

I still cannot figure out what is going on. There seems to be two issues:

  • From looking at the verbose log, when there's a .stow-global-ignore, ~/.stow-global-ignore seems to be ignored.

  • When I have .*\.env in both files, it still does not get ignored.

...
  Using ignore file: ../../.dotfiles/.bin/scripts/.stow-local-ignore
    Using memoized regexps from ../../.dotfiles/.bin/scripts/.stow-local-ignore
    Ignore list regexp for paths:    /(?^:(^|/)(^/\.stow\-local\-ignore$)(/|$))/
    Ignore list regexp for segments: /(?^:^(src|.*\.env|dir_colors)$)/
  Not ignoring dynu.sh
Stowing ../../.dotfiles/.bin / scripts / dynu.sh
  => ../../.dotfiles/.bin/scripts/dynu.sh
  is_a_link(dynu.sh)
  link_task_action(dynu.sh): link task exists with action remove
  is_a_link(dynu.sh): returning 0 (remove action found)
  is_a_node(dynu.sh)
  link_task_action(dynu.sh): link task exists with action remove
  dir_task_action(dynu.sh): no task
LINK: dynu.sh => ../../.dotfiles/.bin/scripts/dynu.sh (reverts previous action)

from stow.

gutierri avatar gutierri commented on June 5, 2024 1

I confirm the problem.

The .stow-local-ignore rules override the .stow-global-ignore rules. The ideal would be a mix of the two files.

version: from source (4ef5eca)

from stow.

gutierri avatar gutierri commented on June 5, 2024 1

from stow.

gutierri avatar gutierri commented on June 5, 2024 1

from stow.

aspiers avatar aspiers commented on June 5, 2024 1

@gutierri Do you mean this:

From looking at the verbose log, when there's a .stow-global-ignore, ~/.stow-global-ignore seems to be ignored.

I guess that was a typo and meant to say

when there's a .stow-local-ignore, ~/.stow-global-ignore seems to be ignored.

That's not a bug - it's working as designed and documented, because creating a local ignore file is the currently only way to disable patterns in the global one.

That said, I certainly agree that it would be useful to be able to combine both global and local. For that ideally we would have something similar to .gitignore rules, where you can use ! to negate a previous rule. (BTW coincidentally many years ago, I implemented the git check-ignore subcommand!)

from stow.

gutierri avatar gutierri commented on June 5, 2024 1

@gutierri Do you mean this:

From looking at the verbose log, when there's a .stow-global-ignore, ~/.stow-global-ignore seems to be ignored.

I guess that was a typo and meant to say

when there's a .stow-local-ignore, ~/.stow-global-ignore seems to be ignored.

That's not a bug - it's working as designed and documented, because creating a local ignore file is the currently only way to disable patterns in the global one.

That said, I certainly agree that it would be useful to be able to combine both global and local. For that ideally we would have something similar to .gitignore rules, where you can use ! to negate a previous rule. (BTW coincidentally many years ago, I implemented the git check-ignore subcommand!)

You are right. It was a typing error.

When I have .\*\.env in both files, it still does not get ignored.

This does sound like a bug if true, but if that's reproducible please file a separate issue for it.

From this issue(#89), the only thing that needs to be investigated is the .*\.env. But I don't know if it makes sense to keep this isue open for that about .*\.env. I will analyze this problem in the coming weeks, and come back with some results, if I can reproduce it, I will come back signaling to close this issue and open a new issue about .*\.env.

from stow.

aspiers avatar aspiers commented on June 5, 2024 1

Thanks, please do file a new issue if needed. I don't think it makes sense to keep this one open, because the global ignore definitely does work in general.

from stow.

eggbean avatar eggbean commented on June 5, 2024

Can anybody else confirm that ~/.stow-global-ignore doesn't work? Does anybody know if it worked in any previous versions? I could consider downgrading to an earlier version if it doesn't have the issues of the current version and if that version doesn't lack any features that I use.

from stow.

eggbean avatar eggbean commented on June 5, 2024

Thanks for confirming this. I use this program heavily, so I'm really looking forward to someone fixing the little bugs present in the current version.

from stow.

eggbean avatar eggbean commented on June 5, 2024

Me trying to be helpful:

https://metacpan.org/pod/File::Cmp

?

from stow.

gutierri avatar gutierri commented on June 5, 2024

The root of the problem is apparently here (line 1290). It returns the first rule it finds. the ideal would be to end the file checking loop while concatenating what exists.

What prevents this from being quickly fixed by me is time and experience with perl. I'm just a perl hobbyist. And I happen to use stow extensively as well. I hope to fix it soon or maybe some collaborator will help with this too.

stow/lib/Stow.pm.in

Lines 1273 to 1299 in 4ef5eca

sub get_ignore_regexps {
my $self = shift;
my ($dir) = @_;
# N.B. the local and global stow ignore files have to have different
# names so that:
# 1. the global one can be a symlink to within a stow
# package, managed by stow itself, and
# 2. the local ones can be ignored via hardcoded logic in
# GlobsToRegexp(), so that they always stay within their stow packages.
my $local_stow_ignore = join_paths($dir, $LOCAL_IGNORE_FILE);
my $global_stow_ignore = join_paths($ENV{HOME}, $GLOBAL_IGNORE_FILE);
for my $file ($local_stow_ignore, $global_stow_ignore) {
if (-e $file) {
debug(5, " Using ignore file: $file");
return $self->get_ignore_regexps_from_file($file);
}
else {
debug(5, " $file didn't exist");
}
}
debug(4, " Using built-in ignore list");
return @default_global_ignore_regexps;
}

from stow.

eggbean avatar eggbean commented on June 5, 2024

Ask on StackOverflow?

from stow.

gutierri avatar gutierri commented on June 5, 2024

@aspiers Could you classify this issue as a bug (add label bug)?

from stow.

aspiers avatar aspiers commented on June 5, 2024

Can anybody else confirm that ~/.stow-global-ignore doesn't work?

I can confirm that it definitely does work 😜 I've been relying on that for years myself. But as per my previous comment, it does get overridden by a .stow-local-ignore.

from stow.

aspiers avatar aspiers commented on June 5, 2024

When I have .*\.env in both files, it still does not get ignored.

This does sound like a bug if true, but if that's reproducible please file a separate issue for it.

from stow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.