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

[Branch View] manual merge tag #7979

Closed

Conversation

6543
Copy link
Member

@6543 6543 commented Aug 25, 2019

(#7976) Show Merge Tag if it is merged manualy

UI:

manual-merge-demo

@lafriks
Copy link
Member

lafriks commented Aug 26, 2019

Imho this should be checked on push and saved to pr

@6543
Copy link
Member Author

6543 commented Aug 26, 2019

Imho this should be checked on push and saved to pr

I dont understand? What do you mean?

@lafriks
Copy link
Member

lafriks commented Aug 26, 2019

Imho this should be checked on push and saved to pr

I dont understand? What do you mean?

Nevermind, it's late I thought it is about PRs manual merge displaying :)

@6543
Copy link
Member Author

6543 commented Aug 26, 2019

do it the short way ... #7976 (comment)

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 26, 2019
@6543 6543 changed the title [Branch View] [WIP] manual merge tag [Branch View] manual merge tag Aug 26, 2019
@codecov-io
Copy link

codecov-io commented Aug 26, 2019

Codecov Report

Merging #7979 into master will increase coverage by 0.01%.
The diff coverage is 40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7979      +/-   ##
==========================================
+ Coverage   41.79%   41.81%   +0.01%     
==========================================
  Files         497      497              
  Lines       65603    65608       +5     
==========================================
+ Hits        27420    27434      +14     
+ Misses      34667    34659       -8     
+ Partials     3516     3515       -1
Impacted Files Coverage Δ
routers/repo/branch.go 55.23% <40%> (-0.38%) ⬇️
models/repo_list.go 74.14% <0%> (+0.97%) ⬆️
models/repo_indexer.go 70.15% <0%> (+1.93%) ⬆️
modules/process/manager.go 81.15% <0%> (+4.34%) ⬆️
models/unit.go 67.56% <0%> (+5.4%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a82850...99c8ab0. Read the comment docs.

@6543 6543 mentioned this pull request Aug 26, 2019
14 tasks
@lunny lunny added the type/enhancement An improvement of existing functionality label Aug 27, 2019
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 27, 2019
@6543
Copy link
Member Author

6543 commented Aug 29, 2019

@lafriks can you review it?

Copy link
Member

@gary-kim gary-kim left a comment

Choose a reason for hiding this comment

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

Just to ask, is this also going to indicate a branch is merged if the branch was just created and pushed from the master branch?

options/locale/locale_en-US.ini Outdated Show resolved Hide resolved
@6543
Copy link
Member Author

6543 commented Sep 1, 2019

Just to ask, is this also going to indicate a branch is merged if the branch was just created and pushed from the master branch?

It does. -> #7976 (comment)

@gary-kim
Copy link
Member

gary-kim commented Sep 1, 2019

Just to ask, is this also going to indicate a branch is merged if the branch was just created and pushed from the master branch?

It does. -> #7976 (comment)

IMHO, having those branches that have no commits ahead of the master being called merged seems a bit weird as it could also mean that the branch was just created. That may cause some confusion.

@6543
Copy link
Member Author

6543 commented Sep 3, 2019

we can check if it is at least one commit behind the default one to avoid souch or if it doesnt use to mouch cpu time lookup the merge commit

@lunny
Copy link
Member

lunny commented Sep 3, 2019

We also could detect if the second commit of the branch is not the second one of the default branch.

@6543
Copy link
Member Author

6543 commented Sep 3, 2019

We also could detect if the second commit of the branch is not the second one of the default branch.

nice idear this would save lookup time and works with a lot of constructs ...
but if something is merged without --no-ff and no commits betwen it will not show up as merged ...
but i personaly have no problem with that :D

current_branch.comit.parentcommit == current_branch.comit.parentcommit -> branch merged = false ??

@6543 6543 changed the title [Branch View] manual merge tag [WIP] [Branch View] manual merge tag Sep 3, 2019
@6543
Copy link
Member Author

6543 commented Sep 5, 2019

We also could detect if the second commit of the branch is not the second one of the default branch.

current_branch.comit.parentcommit == current_branch.comit.parentcommit -> branch merged = false ??

to test if divergence.Behind != 0 should have the same impact?

because if branch is 0 Ahead the only way bouth parent commits are the same is that it is also 0 commits behind ...

@6543 6543 changed the title [WIP] [Branch View] manual merge tag [Branch View] manual merge tag Sep 6, 2019
@6543 6543 changed the title [Branch View] manual merge tag [WIP] [Branch View] manual merge tag Sep 18, 2019
if:
 * no commits ahead default branch
 * not same as default branch
@6543 6543 force-pushed the branch-view-manual-merge-tage branch from 1be6cc9 to 8f80f3e Compare October 5, 2019 20:53
@6543
Copy link
Member Author

6543 commented Oct 5, 2019

I cleanup the 22 commits so it is easy to understand - the actual diff is very smal ...

@6543
Copy link
Member Author

6543 commented Oct 5, 2019

Actual State:

manual merge tag if:

  • no commits ahead default branch
  • not same as default branch

UI:

manual-merge-demo

@6543 6543 changed the title [WIP] [Branch View] manual merge tag [Branch View] manual merge tag Oct 5, 2019
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 5, 2019
@6543
Copy link
Member Author

6543 commented Oct 5, 2019

thx now its ready to merge 🚀

EDIT: there is a merge frees for now? (release)

routers/repo/branch.go Outdated Show resolved Hide resolved
Copy link
Member Author

@6543 6543 left a comment

Choose a reason for hiding this comment

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

@lunny changed it ...

routers/repo/branch.go Outdated Show resolved Hide resolved
@6543 6543 requested a review from lunny October 6, 2019 01:01
@@ -203,10 +204,16 @@ func loadBranches(ctx *context.Context) []*Branch {
}
}

isMerged := false
if divergence.Ahead == 0 && divergence.Behind > 0 && ctx.Repo.Repository.DefaultBranch != branchName {
Copy link
Member

Choose a reason for hiding this comment

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

And I thought it again, maybe divergence.Behind > 0 should be divergence.Behind >= 0? Consider a branch just merged to master and no new commits pushed to master.

Copy link
Member Author

Choose a reason for hiding this comment

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

but this also let branches who are clones of default-branch show up as "merged":

git checkout -b testbranch origin/master
git push -u origin testbranch

@lunny lunny added this to the 1.10.0 milestone Oct 6, 2019
@6543
Copy link
Member Author

6543 commented Oct 6, 2019

Close thiss issue because of brainstorm with lunny

...
lunny:
So Is it possible to know it's a cloned branch or a merged branch?
...
6543:
as far as i know there is no way cou can be sure
...
6543:
i got an idear but this will add a fourth lable to the branch view
if we dont calle it "manualy merged" but "included"
...

@6543 6543 closed this Oct 6, 2019
@lunny lunny removed this from the 1.10.0 milestone Oct 6, 2019
@6543 6543 deleted the branch-view-manual-merge-tage branch October 10, 2019 02:48
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants