When comparing two branch where the source branch was created from the target branch some commits before the diff of the branches provides two many results.
I would suggest to enhance the git diff command.
currently you are using
git diff sourcebranch..targetbranch
You can enhance this if you want to "ignore" changes on the target branch that have be done after source branch was created from target branch by using the following command :
git diff --name-status $(git merge-base targetbranch sourcebranch) sourcebranch <path>
None
None
Hi @struthe
That is effectively very smart!
It could be done directly depending on the shell syntax in use
$ sfdx sgd:source:delta -r . -f $(git merge-base target source) -t target -d
Or in two times :
$ ancestor=$(git merge-base target source)
$ sfdx sgd:source:delta -r . -f ancestor -t target -d
Currently the plugin allows to use any git sha pointer (tag, sha, branch) so all the power is in the hand of the end user and it gives a lot of flexibility.
I wonder if we should implement it directly in the cli or if we should document an example to use this git behavior.
My opinion is we should just document this usage in the readme
@mehdisfdc any thought here ?
Hi @scolladon
thank you very much for your Feedback.
Supplementing the point in the documentation would be sufficient.
The point you show was something that I was not aware of and might help other to understand the usage.
Thanks
Thank you @struthe for bringing this to our attention!
I agree that an additional to the documentation would be useful!
@struthe @scolladon I've opened https://github.com/scolladon/sfdx-git-delta/pull/105 to update the readme, it that enough in your opinion? Feel free to suggest any change to this example if you feel that more explanation are needed.
Most helpful comment
Hi @scolladon
thank you very much for your Feedback.
Supplementing the point in the documentation would be sufficient.
The point you show was something that I was not aware of and might help other to understand the usage.
Thanks