From: "謝晉凡 Hsieh Chin Fan" <kernel@topo.tw>
To: git@vger.kernel.org
Subject: Re: Branch Awareness
Date: Thu, 19 Nov 2026 08:27:59 -0400 [thread overview]
Message-ID: <av7rT2dKR1zguMeN@dell> (raw)
In-Reply-To: <CAA8YNQAsyUe275DLPRnB4dym5aq9ZyemA39u+HJciKzat5tNQA@mail.gmail.com>
.gitignore is itself a tracked file. A merge from feature into main
would also merge the branch rules. This makes the rules hard to reason
about.
What Git already provides based on .git/config:
# .git/config
[includeIf "onbranch:feature/**"]
path = .git/feature.config
# .git/feature.config
[core]
excludesFile = .git/feature.ignore # contains: settings.py
$ git switch main ; git status -s -> ?? settings.py
$ git switch feature/x ; git status -s -> (nothing)
On Thu, Nov 19, 2026 at 11:54:02AM +0200, Jordan K wrote:
>I have a situation at my current workplace that led me to consider this feature:
>
>We crudely pass around a `settings.py` file that doesn't match the one
>stored in our `main` branch, as many workplaces do.
>
>Feature request:
>Allow `.gitignore` branch awareness, so that changes/the existence of
>a specific file are ignored in all branches that are not
>`specific-branch-name` or ignore the file in ONLY
>`specific-branch-name`
>
>Sor of like a whitelist/blacklist flag (there should be an option to
>use either).
>
>I think this is an impactful feature, as many git users have
>situations where they need to ignore Django migration files, local
>settings files, compiled binary changes, etc etc but those files _do_
>need to exist and be included on the staging/main branches
>
>Regards
>Jordan Kadish
>
--
謝晉凡 Hsieh Chin Fan
site: https://topo.tw/about
timezone: GMT-4
prev parent reply other threads:[~2026-11-19 12:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 9:54 Branch Awareness Jordan K
2026-11-19 12:27 ` 謝晉凡 Hsieh Chin Fan [this message]
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=av7rT2dKR1zguMeN@dell \
--to=kernel@topo.tw \
--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.
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.