All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thurston Stone <tstone2077@protonmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>,
	"gitgitgadget@gmail.com" <gitgitgadget@gmail.com>
Subject: Re: [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264)
Date: Wed, 17 Jul 2019 17:12:14 +0000	[thread overview]
Message-ID: <YmOpqT5Q4a9QdU5RJmIbisRhQMnkcZt7GFT7E0xH4cqAWr0mEiHlYzLmpI8eKSPPQDZmQRmfUzdzqxDSb-iBwYhFHtJ6edCFb8I05ld0vFM=@protonmail.com> (raw)
In-Reply-To: <gitgitgadget/git/pull/264/c512358757@github.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



       reply	other threads:[~2019-07-17 17:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <gitgitgadget/git/pull/264@github.com>
     [not found] ` <gitgitgadget/git/pull/264/c512358757@github.com>
2019-07-17 17:12   ` Thurston Stone [this message]
2019-07-17 17:15     ` [gitgitgadget/git] Adding git-ignore command, tests, and documentation. (#264) Thurston Stone

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

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

  git send-email \
    --in-reply-to='YmOpqT5Q4a9QdU5RJmIbisRhQMnkcZt7GFT7E0xH4cqAWr0mEiHlYzLmpI8eKSPPQDZmQRmfUzdzqxDSb-iBwYhFHtJ6edCFb8I05ld0vFM=@protonmail.com' \
    --to=tstone2077@protonmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.