-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
git module diff mode is excessively verbose #28319
Comments
@pjnagel Thanks for this feature request and the detailed list of suggested fixes! I fully agree with the basic idea that the diff is too verbose for some usecases. In some other cases having the full diff in the logs is very nice. Some comments on your suggestions (I'll call them 1-4)
Maybe another workaround/fix for your usecase: Overall I'd leave this as |
I am responsible for the diff support, and figured it's better to have diff support (even if it was verbose) than not having it, as people can decide if they want it or not. At the same time I asked for having a per-task way to enable/disable it.
|
I agree with your assessment of my proposals. Option 2 would be of the highest value to me, since it would solve my problem while still giving me useful feedback from git module in diff mode. If option 2 is implement, I personally won't have any immediate need for option 3, but I agree with you and @dagwieers that it would be a generally useful option. Option 5 is technically feasible, but I am loathe to do so (other than as workaround) since it would be a very brittle solution that would required tricky regexes or something similar to filter out the unwanted part of the diff output. Also, the diff on a large git repository can sometimes be very large (on the order of hundreds of megabytes or gigabytes), so solution 5 could impose a lot of memory pressure on a server (as could the current implementation of diff mode for the git module). |
PS Don't call the option |
@pjnagel Wrt. having a terse/full output mode from within Ansible, this could be done by sending this information to the module, add some helper methods to AnsibleModule for handling diff output and letting the module take care of this. I think there is a dire need for this, now people mess with the result dictionary themselves, but just like we now have module.warn() we should probably have a module.diff() or other helper functions. |
Thank you very much for your submission to Ansible. It means a lot to us that you've taken time to contribute. Unfortunately, this issue has been open for some time while waiting for a contributor to take it up but there does not seem to have been anyone that did so. So we are going to close this issue to clear up the queues and make it easier for contributors to browse possible implementation targets. However, we're absolutely always up for discussion. Because this project is very active, we're unlikely to see comments made on closed tickets and we lock them after some time. If you or anyone else has any further questions, please let us know by using any of the communication methods listed in the page below: In the future, sometimes starting a discussion on the development list prior to proposing or implementing a feature can make getting things included a little easier, but it's not always necessary. Thank you once again for this and your interest in Ansible! |
ISSUE TYPE
COMPONENT NAME
git module
ANSIBLE VERSION
SUMMARY
When running git module under ansible diff mode, the output contains a complete diff of the changes that are made to the files under source control. Depending on the number of commits, this could be huge, which is an issue for network bandwidth too.
On the other hand, not running ansible in diff mode is not always an option, because the debugging output provided by diff mode is extremely valuable.
For example, our workflow is to run ansible --check --diff at every release where out deployment playbooks have seen significant development. But all our other codebases also have a lot of commits at each release, which makes ansible --check --diff a lot less useful than it would be otherwise, and causing us to do a lot of manual pulling in various git repositories just to reduce the output spewage.
I see several different potential solutions, from simple to more complex:
The text was updated successfully, but these errors were encountered: