[FEATURE] -h2h flag implementation#61
Open
qfornaguera wants to merge 9 commits into
Open
Conversation
…en base branch and the current branch `HEAD` to `HEAD` instead of looking for the shared root commit. This is different behavior than `-merge` flag, since `-merge` compares last merged commit and parent or in case there's not, the `HEAD` This might be useful for those who merge/update their base branch to their development branch in the development pipeline
…es between base branch and the current branch `HEAD` to `HEAD` instead of looking for the shared root commit." This reverts commit 688f58c. unintended push
…en base branch and the current branch `HEAD` to `HEAD` instead of looking for the shared root commit. This is different behavior than `-merge` flag, since `-merge` compares last merged commit and parent or in case there's not, the `HEAD` This might be useful for those who merge/update their base branch to their development branch in the development pipeline
[FEATURE] `-h2h` flag implemetation
qfornaguera
commented
May 9, 2025
Comment on lines
-170
to
-195
| out, err := execWithStderr(exec.Command("git", "rev-parse", "--show-toplevel")) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| root := strings.TrimSpace(string(out)) | ||
| // get the revision from which HEAD was branched from g.baseBranch. | ||
| parent1, err := g.branchPointOf("HEAD") | ||
| root, err := g.root() | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
|
|
||
| // If the branch point is unknown, fall back to using the base branch. In | ||
| // most cases, this will be fine, but results in a corner case when base | ||
| // branch has been merged into the branch since branch was created. In | ||
| // that case, the differences from the base branch and the most recent | ||
| // merge will not be considered. | ||
| if parent1 == "" { | ||
| parent1 = g.baseBranch | ||
| } | ||
|
|
||
| rightwardParents := []string{"HEAD"} | ||
| if g.useMergeCommit { | ||
| parent1, rightwardParents, err = g.getMergeParents() | ||
| if err != nil { | ||
| return nil, err | ||
| } |
Author
There was a problem hiding this comment.
moved to getParents() (line:228)
[README] Updating to add `-h2h` and other args info
jbret89
approved these changes
May 9, 2025
[UPGRADE] go1.25.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding a -h2h flag option for the tool so it compares changes between base branch and the current branch
HEADtoHEADinstead of looking for the shared root commit.This is different behavior than
-mergeflag, since-mergecompares last merged commit and parent or in case there's not, theHEADThis might be useful for those who merge/update their base branch to their development branch in the development pipeline.