You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to supply single commit message for multiple repos? #184
When running meta git commit I'm asked to supply a commit message for each sub-project individually. Quite often I want to supply the same, lengthy commit message to all projects. Is there a way to ask meta to use just one commit message for all commits?
@patrickleet@mateodelnorte The issue with using "-m" on the command line is that my commit message is rather long. I tend to include significant detail in my commits, so writing on the command line is pretty inconvenient. I could type out the commit message in a separate file and then supply it with "-F", but again, it's not quite the same workflow I'm used to. What would be amazing is an option to "meta git commit" that popped up my editor to enter a commit message, but then used that commit message for all subrepos.
That would be a pretty complex operation, I imagine. Perhaps it might be possible to write to open $EDITOR and save to known file locations? Care to look into it and let us know what you find?
The commit message on that branch describes a little of the mechanism I used, but it's largely as described in your comment above. The issue remaining to be resolved is the trigger for activating the single commit mode. Right now it checks if the -F flag has been provided to the commit command, and if it has a value of same it opens an editor and uses the results of that for all subrepositories. Of course this isn't ideal, "-F same" is a bit strange. The reason I wanted to make it an overload of the -F flag is that it doesn't make sense to enter a single commit mode and also supply a file for use with -F; overloading it like this makes that impossible.
What are your thoughts?
P.S. I wanted to use something like -F - which I think would be cleaner, but it looks like command line argument processing strips away the trailing -.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
patrickleet commentedon Jul 25, 2019
same as
git committo append a message it's
git commit -m 'fix: the fix was made'in meta, just prefix the same command with
metameta git commit -m 'fix: the fix was made'mateodelnorte commentedon Jul 25, 2019
This is where
metashines.git is smart enough to perform no-ops on any repos that don't have changes.
furious-luke commentedon Jul 26, 2019
@patrickleet @mateodelnorte The issue with using "-m" on the command line is that my commit message is rather long. I tend to include significant detail in my commits, so writing on the command line is pretty inconvenient. I could type out the commit message in a separate file and then supply it with "-F", but again, it's not quite the same workflow I'm used to. What would be amazing is an option to "meta git commit" that popped up my editor to enter a commit message, but then used that commit message for all subrepos.
mateodelnorte commentedon Jul 26, 2019
That would be a pretty complex operation, I imagine. Perhaps it might be possible to write to open $EDITOR and save to known file locations? Care to look into it and let us know what you find?
furious-luke commentedon Jul 26, 2019
Yeah for sure, I'll have a poke around today and see how difficult it looks. Thanks for the help!
furious-luke commentedon Jul 26, 2019
Hey again @mateodelnorte, I've forked your
meta-gitrepo and added a branch that I think goes most of the way to adding the feature, take a look here: https://github.com/furious-luke/meta-git/tree/feat/single-commitThe commit message on that branch describes a little of the mechanism I used, but it's largely as described in your comment above. The issue remaining to be resolved is the trigger for activating the single commit mode. Right now it checks if the
-Fflag has been provided to the commit command, and if it has a value ofsameit opens an editor and uses the results of that for all subrepositories. Of course this isn't ideal, "-F same" is a bit strange. The reason I wanted to make it an overload of the-Fflag is that it doesn't make sense to enter a single commit mode and also supply a file for use with-F; overloading it like this makes that impossible.What are your thoughts?
P.S. I wanted to use something like
-F -which I think would be cleaner, but it looks like command line argument processing strips away the trailing-.mateodelnorte commentedon Jul 29, 2019
You don't need to have a temp file, if you want to use
git commit -F. You can tell it to listen from stdin: https://stackoverflow.com/questions/39261961/whats-the-use-of-standard-input-mode-for-git-commit-f-in-git-bash-for-wi.Go ahead and create a PR for your branch and we can continue the conversation there.
mateodelnorte commentedon Jul 29, 2019
Ah, just read the last sentence. Can you pinpoint where / how the
-is getting stripped?stale commentedon Sep 27, 2019
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.