Git Product home page Git Product logo

Comments (8)

AbdealiLoKo avatar AbdealiLoKo commented on May 25, 2024

Could you explain this issue a bit more ?
I have no idea what it's about

from coala-quickstart.

sils avatar sils commented on May 25, 2024

The gitignore already contains globs to ignore e.g. generated files. We need to ignore e.g. for python projects the build directory in the coafile and the gitignore, this issue is about coala-quickstart using gitignore to generate the ignore setting for a coafile automatically.

from coala-quickstart.

AbdealiLoKo avatar AbdealiLoKo commented on May 25, 2024

Ahh, i see - so, it's auto filling the coafile ignore setting using
gitignore.

Just a note: hgignore has a similar syntax to gitignore - could do that too
?

Also, Our globs and gitignore globs are not similar.
For example, "build" in gitignore means /build/ or similar in our
globs. But ".pyc" would be */.pyc. etc

On Sun, Mar 6, 2016 at 12:25 AM, Lasse Schuirmann [email protected]
wrote:

The gitignore already contains globs to ignore e.g. generated files. We
need to ignore e.g. for python projects the build directory in the coafile
and the gitignore, this issue is about coala-quickstart using gitignore to
generate the ignore setting for a coafile automatically.


Reply to this email directly or view it on GitHub
#13 (comment)
.

from coala-quickstart.

adtac avatar adtac commented on May 25, 2024

@AbdealiJK I verified the following: (tracked - doesn't match, untracked - matches)

  • with .c: ./file.c is still tracked
  • with *.c: ./file.c is untracked
  • with *.c: ./test1/file.c is untracked
  • with .c: ./test1/file.c is obviously tracked
  • with **.c: ./test1/file.c and ./file.c and are both untracked
  • with .c and *.c: ./.c is untracked
  • with file: ./file and ./test/file are both untracked

Now consider only ./test/build/test2/file.c.

  • with build - untracked
  • with test - untracked
  • with file - tracked
  • with file.c - untracked
  • with /build, /file.c - tracked
  • with /test - untracked
  • with test/, build/ - untracked

This is getting really weird and I'm super confused. However I found this JavaScript library that converts from gitignore globs to some other glob format (however I'm unsure whether our glob is same as that).

from coala-quickstart.

AbdealiLoKo avatar AbdealiLoKo commented on May 25, 2024

Nearly All of those make sense to me, why are you confused? Have you read https://git-scm.com/docs/gitignore ?

The only case which doesn't make sense is
Pattern: 'test' tracking the file './test/build/test2/file.c'. Imo it shouldn't, can you recheck?

from coala-quickstart.

adtac avatar adtac commented on May 25, 2024

@AbdealiJK For instance build matches the file, which doesn't feel intutive to me (because it's not in the root directory). But that's probably because I'm thinking very verbose - I'd prefer for only **/build/** to match the file instead of build, but I totally understand build matching the file is simpler.

And you're right, test does make the file untracked. Sorry about that 😅

from coala-quickstart.

Makman2 avatar Makman2 commented on May 25, 2024

it's quite simple: every untracked file that matches a pattern in gitignore is ignored. If it's already tracked it isn't ignored. You can make it ignored again when you delete the file from the repository.

from coala-quickstart.

adtac avatar adtac commented on May 25, 2024

https://gist.github.com/hypothesist/d58073e5add2f1d5abc5e66183bddeb2

From Gitter:

@AbdealiJK [ref] -

  • Not sure if \ is also acceptable for windows (instead of the first /), so maybe test that out ?
  • Your is_glob_exp checks for ( but what about ( in file names ? like the Windows pesky "Program files (x86)" ? Will it get confused by that ?
  • You seem to be adding ** in the line 6,7 - what if it's not a directory ? like if I ignore /.coverage or /npm-log.txt or /Gemfile.lock
  • os.path.join(os.path.join(project_dir, "**"), line) == os.path.join(project_dir, "**", line)
  • What about a case like I do test.c in my gitignore and I happen to have a folder named test.c - will the contents of the folder be ignored by git ? (Your code does ignore the contents of the folder)

me [ref] -

  • I just verified on Windows: /cov successfully ignores a file cov in the root directory.
  • test (1|2) ignores a file called test (1|2) (literally). But test (1|2) never ignores a directory/file named test 1. Does git even support alternatives? Although test [12] ignores test 1. Anyway, a file called test [1] is not ignored when I add the same to .gitignore. However it is ignored when I escaped the [ and ]. So the fix is simple: before checking for *!?[](not no parens, ?, |), remove all escaped characters?
  • How about adding both ./cov and ./cov/** to the glob list? There can never exist a file and dir with the same name at the same place, so this should cover both and exactly the one that's there?
  • git does ignore a directory called test.c when test.c is added to .gitignore

from coala-quickstart.

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.