git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Re: [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264)
       [not found] ` <gitgitgadget/git/pull/264/c512358757@github.com>
@ 2019-07-17 17:12   ` Thurston Stone
  2019-07-17 17:15     ` Thurston Stone
  0 siblings, 1 reply; 2+ messages in thread
From: Thurston Stone @ 2019-07-17 17:12 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org, gitgitgadget@gmail.com

> Wouldn't this simpler to type and less error prone, as you do
> have to
>	$ cd path/to/the
>	... work in that deep
>	... realize that file.txt in that directory needs ignoring ...
>	$ echo file.txt > .gitignore
that would have "path/to/the/.gitignore" which contains "file.txt".
Whereas that does work fine, it can be cumbersome to manage a multitude
gitignore files (it can get out of hand). If a policy is in place to
consolidate this management into the root gitignore, they'd have to run:

$ cd path/to/the
	... work in that deep directory ...
	... realize that file.txt in that directory needs ignoring ...
	... know relative path of both desired ignore file and cwd ...
$ echo path/to/the/file.txt > ../../../.gitignore
	... or with this script ...
$ git ignore path/to/the/file.txt

Another example might be when the code is deeper embeded, like a
java library path.
$ cd code/src/com/mylib
	... work under that directory ...
	... realize subclass/helpers/testdata.json needs ignoring ...
 	... need to know the full path of ignore file, cwd, and
		the relative path to root gitignore ...
$ echo code/src/com/mylib/subclass/helpers/testdata.json > ../../../../.gitignore
- or the more intuitive: -
$ git ignore subclass/helpers/testdata.json
- both ending in the same result
$ cat ${REPO_ROOT}/.gitignore
code/src/com/mylib/subclass/helpers/testdata.json



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

* Re: [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264)
  2019-07-17 17:12   ` [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264) Thurston Stone
@ 2019-07-17 17:15     ` Thurston Stone
  0 siblings, 0 replies; 2+ messages in thread
From: Thurston Stone @ 2019-07-17 17:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git@vger.kernel.org, gitgitgadget@gmail.com

my mistake, my last email should have read:

$ cd path/to/the
 ... work in that deep directory ...
 ... realize that file.txt in that directory needs ignoring ...
 ... know relative path of both desired ignore file and cwd ...
$ echo path/to/the/file.txt > ../../../.gitignore
     ... or with this script ...
--CORRECTION--
$ git ignore file.txt

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

end of thread, other threads:[~2019-07-17 17:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <gitgitgadget/git/pull/264@github.com>
     [not found] ` <gitgitgadget/git/pull/264/c512358757@github.com>
2019-07-17 17:12   ` [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264) Thurston Stone
2019-07-17 17:15     ` Thurston Stone

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