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

Support commits with inline message #22

Closed
dideler opened this issue May 1, 2018 · 4 comments
Closed

Support commits with inline message #22

dideler opened this issue May 1, 2018 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@dideler
Copy link
Contributor

dideler commented May 1, 2018

Commits made with the -m or --message option won't have the editor invoked, so it won't read the commit template to prepopulate the commit message. That means git mob doesn't work with this style of committing.

Committing with an inline message is discouraged for many reasons, but it's still a common practice.

It'd be surprising behaviour if you're in a mob but an inlined commit doesn't have co-authors.

@dideler dideler added the question Further information is requested label May 1, 2018
@dideler
Copy link
Contributor Author

dideler commented May 1, 2018

We could use the prepare-commit-msg hook. Tested it with an inline message and it works with a trailer.

Inside the hook we could use the plumbing command git interpret-trailers to add or parse structured information in commit messages.

$ git interpret-trailers -h
usage: git interpret-trailers [--in-place] [--trim-empty] [(--trailer <token>[(=|:)<value>])...] [<file>...]

    --in-place            edit files in place
    --trim-empty          trim empty trailers
    --where <action>      where to place the new trailer
    --if-exists <action>  action if trailer already exists
    --if-missing <action>
                          action if trailer is missing
    --only-trailers       output only the trailers
    --only-input          do not apply config rules
    --unfold              join whitespace-continued values
    --parse               set parsing options
    --trailer <trailer>   trailer(s) to add

@rkotze
Copy link
Owner

rkotze commented May 5, 2018

Yeah I agree if we ran commit with -m or --message i would expect co-author to show. 👍

@rkotze rkotze changed the title Support commits with inline message? Support commits with inline message Sep 19, 2018
@rkotze rkotze added enhancement New feature or request and removed question Further information is requested labels Sep 19, 2018
@rkotze
Copy link
Owner

rkotze commented Sep 19, 2018

Since we agree on the approach, I've changed this from a question to an enhancement.

@rkotze rkotze added this to the 1.0.0 milestone Sep 19, 2018
@rkotze rkotze self-assigned this Nov 14, 2018
rkotze added a commit that referenced this issue Nov 15, 2018
Plan is to allow for a customisable approach to setup a
prepare-commit-msg hook to enable inline message.

I think it would be risk for git-mob to install the hook into project
which might already them setup and potentially breaking it.

Fallback will still be using the standard git template with the option
to use the prepare hook.
@rkotze
Copy link
Owner

rkotze commented Nov 22, 2018

Solved in release v0.4.0.

@rkotze rkotze closed this as completed Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants