Skip to content

[FEATURE] -h2h flag implementation#61

Open
qfornaguera wants to merge 9 commits into
digitalocean:masterfrom
tangelo-labs:master
Open

[FEATURE] -h2h flag implementation#61
qfornaguera wants to merge 9 commits into
digitalocean:masterfrom
tangelo-labs:master

Conversation

@qfornaguera

@qfornaguera qfornaguera commented May 9, 2025

Copy link
Copy Markdown

Adding a -h2h flag option for the tool so it compares changes between 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.

Screenshot 2025-05-09 at 16 16 13

…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
Comment thread differ.go
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
}

@qfornaguera qfornaguera May 9, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to getParents() (line:228)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants