Comments (8)
Hi,
Thanks for your interest :)
Yes, removing the manual parts was something we quickly discussed on twitter yesterday. I'm still thinking about what would be the best way to remove these parts. I thought something could be done with the prepare-commit-msg
git hook. But as nothing is ready now, I'm quite open for new ideas :)
What would be the workflow with your command?
- you run the
composer update
as usual - then you run the command
commit-lockfile
?
So, unless I'm wrong, we will need to store the summary somewhere, maybe a file in the temp directory? Or do you see another way?
from composer-changelogs.
Ok, let's throw some ideas around..
-
Yes, a
prepare-commit-msg
orcommit-msg
git hook would work -
I initially thought that a single run of
composer update --commit-lockfile
could work, because its not used by Composer itself, yet. When the "Changelog Summary" is a buffered output you could display it on screen and then do aexec('git commit -m "' . $changelogSummary . '" path/to/composer.lock');
. Probably followed by a message that the lock file was committed automatically. -
For a two command approach: the
composer update
run could generate a filebin/commit-lockfile.sh
using a template approach for the file content.The output could look like:
#!/bin/sh # File generated by Composer Plugin "Changelogs". git commit -m "Changelog Summary ..." path/to/composer.lock
The second command is then simply
bin/commit-lockfile.sh
. -
Another idea: use CLI interaction. The plugin could question the user by default, if he wants to commit the composer.lock file - directly after displaying the Change Summary.
This would work because Composer has the CLI argument--no-interaction (-n)
to stop asking any interactive question. That leaves there cases to handle:- Question "Do you want to commit the composer.lock file?"
- if Yes, commit the file with summary
- if No, output changelog and end
- If
--no-interaction
output changelog and end (internally probably skipping the question handler).
- Question "Do you want to commit the composer.lock file?"
Maybe leave the issue open for a while to fetch more opinions..
from composer-changelogs.
Wooot, quite good ideas here :-)
I really like the interactive one. No other command required, integrate smoothly in Composer and the behavior can be controlled by the user.
Let's see if we can get others opinions.
from composer-changelogs.
Hi
I actually try your plugin and I had the same thought as jakoch about remove manual action.
So, is that issue still alive and do you work on it ?
And for me I like the interactive solution too.
from composer-changelogs.
Hi :)
The issue is still opened but I didn't start working on it. I'm afraid that automatically trigger a commit could be something that a lot of people could consider surprizing/bad, even in an interactive way.
Maybe we could add an extra setting in the composer.json (global or local) to trigger the interactive question. This default setting would not display the question. Does this workflow could satisfy your use case, you and @jakoch?
from composer-changelogs.
May be I have another idea.
can we just add an extra setting in the composer.json in order to set a bin file (.sh, .php, .bat, ...) who will be run at the end of update. And your plugin create a tmp file with the changelog output.
So, the dev should just add the option in composer.json and create a bin file who he can do what he want like read the tmp file and add it to a commit message.
from composer-changelogs.
With an example it will be more clear:
public function postUpdate(Event $event)
{
$extra = $event->getComposer()->getPackage()->getExtra();
if (array_key_exists('changelog', $extra)) {
$logFile = $extra['changelog']['log-file'];
$binFile = $extra['changelog']['bin-file'];
exec($binFile);
}
$this->io->write($this->outputter->getOutput());
}
#!/bin/sh sh
value=`cat /tmp/changelog.log`
git commit -m"$value" composer.lock
Something like that, with check if files exists and maybe some other check but it's the main idea.
from composer-changelogs.
Hi, thanks for all your propositions. Before your message, I started a POC for extra settings in ee0aaa0
I started with the previous idea of asking, then eventually commiting but it's obviously only coupled to git. I will look to your solution soon as it's enable others possibilies
from composer-changelogs.
Related Issues (20)
- PHP Fatal error: Cannot redeclare class SLLH\ComposerVersionsCheck\VersionsCheckPlugin in Composer/Plugin/PluginManager.php(246) HOT 3
- Undefined index: scheme HOT 2
- Suggestion: Show changelog via composer.lock log HOT 2
- problem infering zend tags HOT 7
- Exception when installing "Undefined index: scheme" HOT 2
- Support for gitlab HOT 5
- Plugin can be register with a little hack HOT 1
- Detect downgrades HOT 1
- Lower PHP version requirement to 5.3 HOT 1
- Running the auto-commit after composer scripts HOT 3
- Change how classes are force-autoloaded HOT 1
- Improve the "composer outdated" command output HOT 1
- Long format changes description HOT 2
- Display VCS Revision for dev-xyz HOT 3
- Drop old PHP versions HOT 2
- Update to Composer 2
- Add option to output to Markdown table HOT 7
- Usage with --dry-run HOT 3
- Deprecation Notice: strpos(): Passing null to parameter #1 HOT 4
- Error when upgrading to v2.0.0 (Cannot assign Pyrech\ComposerChangelogs\Config\Config to property) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from composer-changelogs.