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

Change git diff command #101

Closed
struthe opened this issue Feb 18, 2021 · 3 comments · Fixed by #105
Closed

Change git diff command #101

struthe opened this issue Feb 18, 2021 · 3 comments · Fixed by #105
Assignees
Labels
enhancement New feature or request

Comments

@struthe
Copy link

struthe commented Feb 18, 2021

Is your proposal related to a problem?

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.

Describe the solution you'd like

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>

Describe alternatives you've considered

None

Additional context

None

@struthe struthe added the enhancement New feature or request label Feb 18, 2021
@scolladon
Copy link
Owner

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 ?

@struthe
Copy link
Author

struthe commented Feb 22, 2021

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

@mehdicherf
Copy link
Collaborator

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 #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.

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

Successfully merging a pull request may close this issue.

3 participants