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

[GSOC] commit: add own-identity option #909

Conversation

adlternative
Copy link

@adlternative adlternative commented Mar 19, 2021

This patch series is the basis for commit --trailer in #901
and provides --own-identity option for --trailer.

Junio's suggestion is that we can provide --trailer="@SomeOne"
in the later stages to support filling multiple identities which obtain
from git log.

cc: Bradley M. Kuhn bkuhn@sfconservancy.org
cc: Junio C Hamano gitster@pobox.com
cc: Brandon Casey drafnel@gmail.com
cc: Shourya Shukla periperidip@gmail.com
cc: Christian Couder christian.couder@gmail.com
cc: Rafael Silva rafaeloliveira.cs@gmail.com
cc: Đoàn Trần Công Danh congdanhqx@gmail.com

Historically, Git has supported the 'Signed-off-by' commit trailer
using the '--signoff' and the '-s' option from the command line.
But users may need to provide other trailer information from the
command line such as "Helped-by", "Reported-by", "Mentored-by",

Now implement a new `--trailer <token>[(=|:)<value>]` option to pass
other trailers to `interpret-trailers` and insert them into commit
messages.

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
`git commit --trailer="Signed-off-by: \
$(git config user.name) <$(git config user.email)>"`
is difficult for users to add their own identities,
so teach interpret-trailers a new option `--own-identity`
which allow if we're optionalise <value> in `--trailer`,
by substitute user's identity if missing. This will help
the use of `commit --trailer` as easy as `commit --signoff`.

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
Use the newly added option `--own-identity` in
`interpret-trailers`, implement new commit option
`--own-identity` to allow user optionalise <value>
in `--trailer`, by substitute user's identity if
missing. Using the `--own-identity` option, users
can directly use `--trailer="Signed-off-by"` to
generate a signoff trailer with their own identities
in commit messages,

The effect is basically the same as the `--signoff`
option. However, users can add more useful options at
the same time. e.g. `--trailer="Helped-by" --own-identity`
can general `Helped-by: C O Mitter <committer@example.com>`,
or through appropriate configuration:
`git -c trailer.signoff.key="Signed-off-by" commit \
--trailer="signoff" --own-identity`
can also general their needs trailers with their favorite
keys and their own identities.

Signed-off-by: ZheNing Hu <adlternative@gmail.com>
@adlternative adlternative changed the title [GSOC] commit add own-identity option [GSOC] commit: add own-identity option Mar 19, 2021
@adlternative
Copy link
Author

/submit

@gitgitgadget
Copy link

gitgitgadget bot commented Mar 19, 2021

Submitted as pull.909.git.1616155599.gitgitgadget@gmail.com

To fetch this version into FETCH_HEAD:

git fetch https://github.com/gitgitgadget/git pr-909/adlternative/trailer_own_identity_option-v1

To fetch this version to local tag pr-909/adlternative/trailer_own_identity_option-v1:

git fetch --no-tags https://github.com/gitgitgadget/git tag pr-909/adlternative/trailer_own_identity_option-v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant