Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ident: support per-path configs by matching the path against a pattern #161

Closed
wants to merge 1 commit into from
Closed

ident: support per-path configs by matching the path against a pattern #161

wants to merge 1 commit into from

Conversation

sschuberth
Copy link
Contributor

Support per-path identities by configuring Git like

$ git config user.<pattern>.email <email address>

e.g.

$ git config user.github.email sschuberth+github@gmail.com

In this example, the middle "github" pattern is searched for
case-insensitively in the absolute path name to the current git work tree.
If there is a match the configured email address is used instead of what
otherwise would be the default email address.

Note that repository-local identities still take precedence over global /
system ones even if the pattern configured in the global / system identity
matches the path to the local work tree.

Signed-off-by: Sebastian Schuberth sschuberth@gmail.com

Support per-path identities by configuring Git like

    $ git config user.<pattern>.email <email address>

e.g.

    $ git config user.github.email sschuberth+github@gmail.com

In this example, the middle "github" pattern is searched for
case-insensitively in the absolute path name to the current git work tree.
If there is a match the configured email address is used instead of what
otherwise would be the default email address.

Note that repository-local identities still take precedence over global /
system ones even if the pattern configured in the global / system identity
matches the path to the local work tree.

This change avoids the need to use external tools like [1].

TODO: Once the community agrees that this is a feature worth having, add
tests and adjust the docs.

[1] https://github.com/prydonius/karn

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@submitgit
Copy link
Member

@sschuberth sent this to the mailing list with submitGit - here on Gmane, MARC

@sschuberth
Copy link
Contributor Author

Probably rewrite this based on @peff's suggestion.

@sschuberth sschuberth closed this Jul 22, 2015
kanokwanmaneeon referenced this pull request Apr 12, 2019
In the contributing guide and PR template seen by people who open pull
requests on GitHub, we mention the submitGit tool, which gives an
alternative to figuring out the mailing list. These days we also have
the similar GitGitGadget tool, and we should make it clear that this
is also an option.

We could continue to mention _both_ tools, but it's probably better to
pick one in order to avoid overwhelming the user with choice. After all,
one of the purposes here is to reduce friction for first-time or
infrequent contributors. And there are a few reasons to prefer GGG:

  1. submitGit seems to still have a few rough edges. E.g., it doesn't
     munge timestamps to help threaded mail readers handled out-of-order
     delivery.

  2. Subjectively, GGG seems to be more commonly used on the list these
     days, especially by list regulars.

  3. GGG seems to be under more active development (likely related to
     point 2).

So let's actually swap out submitGit for GGG. While we're there, let's
put another link to the GGG page in the PR template, because that's
where users who are learning about it for the first time will want to go
to read more.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants