git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Rene Pasing <rene@pasing.net>
To: git@vger.kernel.org
Subject: Wrong gitattributes documentation?
Date: Fri, 2 Jun 2017 19:12:36 +0200	[thread overview]
Message-ID: <e7734a23-12b2-8f62-ab5c-c856d59e3010@pasing.net> (raw)

Hi all,

I have noticed a strange behaviour when using git-lfs.

If I understood correctly, git-lfs adds patterns to .gitattributes, for 
which git then calls lfs for any matches with this pattern.

The problem is, the documentation[1] says: "The rules how the pattern 
matches paths are the same as in .gitignore files; see gitignore[5].", 
so when I have a pattern like '/images/', it should match on all 
files+folders under /images, even the directory itself, right? Or when 
I'd use '/images/*', it should match on all files+folders under /images, 
right?

This does not seem to be the case. Nothing is done by lfs when using 
'/images/', and when using '/images/*', it only takes into account files 
which are directly in /images (so it doesnt take into account 
subdirectories).

The only solution to this (until now) is to use '/images/**/*', which 
seems to do exactly what I want (lfs gets executed for all files+folders 
under /images).

Is this expected behaviour? If yes, then the documentation of 
gitattributes seems incorrect to me. If not, can this be considered as a 
bug?

I found several complaints about this to git-lfs (or other projects 
relying on gitattributes), e.g. [2], but I didn't find anything about 
this regarding gitattributes itself.

Thanks for answers
Regards
Rene

PS: $ git --version
git version 2.1.4

[1] = https://git-scm.com/docs/gitattributes
[2] = https://github.com/git-lfs/git-lfs/issues/2068

             reply	other threads:[~2017-06-02 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02 17:12 Rene Pasing [this message]
2017-06-03  0:01 ` Wrong gitattributes documentation? Junio C Hamano
2017-06-03  1:10   ` Rene Pasing
2017-06-03  1:20   ` Rene Pasing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e7734a23-12b2-8f62-ab5c-c856d59e3010@pasing.net \
    --to=rene@pasing.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).