Re: [PATCH] git-check-ignore.txt: Clarify exit codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>> check-ignore disregards whether a path is matched by a
>> positive or negative pattern. Thus for a file that is _not_
>> ignored, but is captured by negative pattern in .gitignore,
>> the exit code is 0. The docs suggested otherwise.
>
> I am not sure that is the actual behaviour of the command.  Given
> this .gitignore file:
>
>     $ cat .gitignore; echo END
>     !vendor.o
>     *.o
>     END
>
> which is designed to allow binary-only blob "vendor.o" supplied by
> the vendor to be tracked, but to ignore all the other usual build
> artifacts, you see this:
>
>     $ for o in a.o vendor.o; do git check-ignore $o >/dev/null; echo $?; done
>     0
>     1
>
> Puzzled...

Maybe your global ignore file gets in the way?

on both of my machines (cygwin + git 2.1.1, linux + git @master) I have:

  $ cat > .gitignore << EOF
  !vendor.o
  *.o
  EOF

  for o in a.o vendor.o; do git check-ignore $o >/dev/null; echo $?; done
  0
  0

which corresponds to how I understand the command so far :)

is one of a.o and vendor.o already in your index?
there is a --no-index as well (which enables yet another different behavior)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]