Skip to content

Commit

Permalink
fix: improve gfd script to make it works for more cases. (dashpay#5561
Browse files Browse the repository at this point in the history
)

## Issue being fixed or feature implemented
Seems as old command `git merge-base --fork-point` doesn't work for some
cases of tree structure

Particularly it didn't worked for PR dashpay#5546:
>  @kwvg kwvg force-pushed the utilbps branch from 82d8a61 to f1bc1c3

Basically, one of the step `gfb` script -- `git merge-base --fork-point
develop 82d8a61` returned me wrong
commit. After pulling origin/develop it returns just an empty string.

But `git show-branch --merge-base develop
82d8a61` worked and returned correct
commit:
"3e1c6dd731 fix: reorder initializations (dashpay#5545)" which is the last
common commit with develop branch


## What was done?
Updated recommended function `function gfd()` in doc

## How Has This Been Tested?
Tested on PR dashpay#5546 that failed before and returned wrong diff for me


## Breaking Changes
N/A

## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation
- [x] I have assigned this pull request to a milestone
  • Loading branch information
knst authored Sep 9, 2023
1 parent deb1e16 commit fa64c64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ before and after commits must be present locally.

```
function gfd() {
local fp1=$(git merge-base --fork-point develop $1)
local fp2=$(git merge-base --fork-point develop $2)
local fp1=$(git show-branch --merge-base develop $1)
local fp2=$(git show-branch --merge-base develop $2)
echo fp1=$fp1
echo fp2=$fp2
diff --color=always -u -I'^[^-+]' <(git diff $fp1..$1) <(git diff $fp2..$2)
Expand Down

0 comments on commit fa64c64

Please sign in to comment.