git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Re: Git excludes fails to avoid git submodule warning
  2019-03-24 18:15 Git excludes fails to avoid git submodule warning Klaatu
@ 2019-03-24  7:58 ` Duy Nguyen
  0 siblings, 0 replies; 2+ messages in thread
From: Duy Nguyen @ 2019-03-24  7:58 UTC (permalink / raw)
  To: Klaatu; +Cc: Git Mailing List

On Sun, Mar 24, 2019 at 6:01 AM Klaatu <klaatu@member.fsf.org> wrote:
>
> Working with Git 2.21.0 on Linux:
>
> The git-add(1) man page says:
>
> "The optional configuration variable core.excludesFile indicates a path to a
> file containing patterns of file names to exclude from git-add"
>
> But if I do this:
>
> $ echo "docs/themes/*/.git >> .gitexcludes
> $ git config core.excludeFiles .gitexcludes
> $ git add docs
>  warning: adding embedded git repository: docs/themes/foo
>
> It seems to me that this goes against what the git-add(1) man page says.
>
> A workaround I found on stackoverflow is to add any file within the target
> directory:
>
> $ git add docs/themes/foo/README
>
> And then add everything:
>
> $ git add docs
>
> In which case the contents of .gitexcludes is honoured. But that seems like a
> hack.

That's because you're not supposed to add files inside another
repository. The "git add docs/theme/foo/README" should have failed.

This kind of sharing part of worktree between two repositories (the
top dir and one in docs/themes/foo) has never been officiaily
supported if I remember it correctly.

> Am I experiencing the intended result of Git's exclude function? If so, I'll
> happily submit a patch to the man page to clarify this behaviour. If not, I
> guess I'm submitting a bug report here.
>
> Thanks for all the amazing work.
-- 
Duy

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Git excludes fails to avoid git submodule warning
@ 2019-03-24 18:15 Klaatu
  2019-03-24  7:58 ` Duy Nguyen
  0 siblings, 1 reply; 2+ messages in thread
From: Klaatu @ 2019-03-24 18:15 UTC (permalink / raw)
  To: git

Working with Git 2.21.0 on Linux:

The git-add(1) man page says:

"The optional configuration variable core.excludesFile indicates a path to a 
file containing patterns of file names to exclude from git-add"

But if I do this:

$ echo "docs/themes/*/.git >> .gitexcludes
$ git config core.excludeFiles .gitexcludes
$ git add docs
 warning: adding embedded git repository: docs/themes/foo

It seems to me that this goes against what the git-add(1) man page says.

A workaround I found on stackoverflow is to add any file within the target 
directory:

$ git add docs/themes/foo/README

And then add everything:

$ git add docs

In which case the contents of .gitexcludes is honoured. But that seems like a 
hack.

Am I experiencing the intended result of Git's exclude function? If so, I'll 
happily submit a patch to the man page to clarify this behaviour. If not, I 
guess I'm submitting a bug report here.

Thanks for all the amazing work.

Cheers.

 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-24  7:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-24 18:15 Git excludes fails to avoid git submodule warning Klaatu
2019-03-24  7:58 ` Duy Nguyen

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).