This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 235338

Summary: [git] commits from other branches are visible in "show history view" and "history tab" - and the user cannot distinguish them
Product: versioncontrol Reporter: markiewb
Component: GitAssignee: Ondrej Vrabec <ovrabec>
Status: RESOLVED FIXED    
Severity: normal CC: git
Priority: P2 Keywords: PLAN
Version: 7.4   
Hardware: PC   
OS: Windows 7   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 235360    
Bug Blocks: 235882    
Attachments: Shows the issue in compare "master" vs "branch"
Sample project for reproduction

Description markiewb 2013-08-30 23:32:10 UTC
Created attachment 139519 [details]
Shows the issue in compare "master" vs "branch"

Ondrej, sorry for opening this P2-issue so close too the code freeze. But IMHO this is a major issue. Today I fell into this trap several times and I wondered - so others will do too. The history tab for a single file is broken the current way - I cannot reliably distinguish the commits.
------

Please have a look at the big screenshot collage I attached to this issue. 
At the top you will see the the commit graph (displayed via "git log --graph"). There are two branches: master, BRANCHFOO. The BRANCHFOO is based on the master branch, but the branches diverged from each other. (I will also attach the sample project.)

On the left side you will see display behaviour of NB for branch "master".
On the right side you will see display behaviour of NB for branch "BRANCHFOO".

ACTUAL:
* When you click "show history" for a project OR a single changed file you will see other commits from branches which are not related to the currently checked-out branch. My expectation is the same output as "git log" (also contained in the screenshot for each branch)
* When you open the "history" tab for a single file you will see other commits from branches which are not related to the currently checked-out branch. My expectation is that only the commits of the current branch of this file are shown.


EXPECTED (and proposals):
* diff tab of "show history view": add an option to "show other branches" (a checkbox, checked by-default to preserve the current behaviour)
* summary tab of "show history view": add an option to "show other branches" (a checkbox, checked by-default to preserve the current behaviour)
* single file history tab: 
** remove the commits from other branches OR 
** display the branch the commit is coming from too OR 
** add an option to "show other branches" (a checkbox, unchecked (!!) by-default for this by-file usecase)

---
Product Version: NetBeans IDE Dev (Build 201308240953)
Java: 1.7.0_25; Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_25-b16
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 markiewb 2013-08-30 23:35:47 UTC
Created attachment 139520 [details]
Sample project for reproduction
Comment 2 Ondrej Vrabec 2013-08-31 06:26:03 UTC
i am afraid this cannot be reliably resolved without having a support for graph visualization in the history view (the RFE is lying somewhere around in bugzilla).
But:
> diff tab of "show history view": add an option to "show other branches" (a checkbox, checked by-default to preserve the current behaviour)
> summary tab of "show history view": add an option to "show other branches" (a checkbox, checked by-default to preserve the current behaviour)
the problem is these most likely not *filters* but *search parameters* that should be provided in the search criteria. If you want to see only current branch, simply add "master" to the "To" field of the criteria panel. I will think about it and try to think of a solution that would be more open and obvious to users.

> remove the commits from other branches OR 
> display the branch the commit is coming from too OR 
> add an option to "show other branches" (a checkbox, unchecked (!!) by-default for this by-file usecase)
Not sure what about these. The history tab is not a full-featured search history view. We could always display only the history for the currently checked out branch, but i need to think this through.
Comment 3 markiewb 2013-08-31 13:57:11 UTC
(In reply to Ondrej Vrabec from comment #2)
> i am afraid this cannot be reliably resolved without having a support for
> graph visualization in the history view (the RFE is lying somewhere around
> in bugzilla).

https://netbeans.org/bugzilla/show_bug.cgi?id=221662 ? I added a POC patch months ago, but I know that there is more to to do than simply wrapping the commit graph component into a TC.

> But:
> ...
> the problem is these most likely not *filters* but *search parameters* that
> should be provided in the search criteria. If you want to see only current
> branch, simply add "master" to the "To" field of the criteria panel. I will
> think about it and try to think of a solution that would be more open and
> obvious to users.

Thank you for considering. Would it be possible that the checkbox puts in (or removes) the current branch name into/from the "To" field and starts the search?

> ...
> Not sure what about these. The history tab is not a full-featured search
> history view. We could always display only the history for the currently
> checked out branch, but i need to think this through.

Thank you too also for working overtimes right now and even work at the weekend to reach the NB74 release quality.
Comment 4 Ondrej Vrabec 2013-09-01 10:18:28 UTC
Benno, i pushed http://hg.netbeans.org/core-main/rev/4d189fb9304e
This is as far i am able and willing to go right now because:
1) we are too close to code freeze to change any UI
2) half a day of my weekend time is kind of as much as i can invest right now, sorry to say this but you should have filed that sooner

So the fix for 7.4 is:
- the history tab
--- it currently displays only git commits reachable from the current HEAD. Makes sense, user is probably interested only in going through the current history chain
--- the tab is automatically refreshed when the history is changed: new commit, checkout of another branch, git reset etc.

- the search history view
--- no fix done, would require to change the UI and probably a discussion with the ui team to change anything there. So you must accept the current state and if necessary set the branch in the To/branch field in the criteria

Let's discuss the show history view in the next release
Comment 5 Ondrej Vrabec 2013-09-01 10:19:19 UTC
One more thing, please test it ASAP (and in detail). I don't expect any regressions but still anything can happen
Comment 6 Quality Engineering 2013-09-02 01:37:17 UTC
Integrated into 'main-silver', will be available in build *201309020001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4d189fb9304e
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #235338 - [git] commits from other branches are visible in "show history view" and "history tab" - and the user cannot distinguish them
- refreshing history tab automatically when the history for a file is changed
- displaying only history commits reachable from the current HEAD
Comment 7 markiewb 2013-09-02 06:49:37 UTC
(In reply to Ondrej Vrabec from comment #5)
> One more thing, please test it ASAP (and in detail). I don't expect any
> regressions but still anything can happen

Thanks you very much Ondrej. Your work is really appreciated. I will test it, promised.
Comment 8 markiewb 2013-09-02 22:15:11 UTC
(In reply to markiewb from comment #7)
> (In reply to Ondrej Vrabec from comment #5)
> > One more thing, please test it ASAP (and in detail). I don't expect any
> > regressions but still anything can happen
> 
> Thanks you very much Ondrej. Your work is really appreciated. I will test
> it, promised.

I tried it today. Several times. Now the history of my pom.xml files looks good. I will continue the test the next days.
Comment 9 Ondrej Vrabec 2013-09-11 13:14:52 UTC
so back to Git -> Search History,,,
- by default it now searches only the current branch
- i added Branch field to the search criteria and a button opening a branch selector, user can modify the field to search another branch or all branches if kept empty
- once you clear the field, next time you open the search history window it searches all branches
- when you enter any branch, next time the search history searches only the current branch again

fix: http://hg.netbeans.org/core-main/rev/be4789b1dc75
Comment 10 markiewb 2013-09-11 17:58:09 UTC
(In reply to Ondrej Vrabec from comment #9)
> so back to Git -> Search History,,,
> - by default it now searches only the current branch
> - i added Branch field to the search criteria and a button opening a branch
> selector, user can modify the field to search another branch or all branches
> if kept empty
> - once you clear the field, next time you open the search history window it
> searches all branches
> - when you enter any branch, next time the search history searches only the
> current branch again
> 
> fix: http://hg.netbeans.org/core-main/rev/be4789b1dc75

I am curious to see this in action. Lets wait for the integration
Comment 11 Ondrej Vrabec 2013-09-11 18:27:52 UTC
(In reply to markiewb from comment #10)
> I am curious to see this in action. Lets wait for the integration
btw, i'm also working on the possibility to filter commits in the search history by branches - something like idea has. But that requires change in the API so will take some time.
Comment 12 Quality Engineering 2013-09-12 01:22:30 UTC
Integrated into 'main-silver', will be available in build *201309120002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/be4789b1dc75
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: #235338 - [git] commits from other branches are visible in "show history view" and "history tab" - and the user cannot distinguish them
Comment 13 Ondrej Vrabec 2013-09-25 14:49:18 UTC
fix: http://hg.netbeans.org/core-main/rev/9c0d15843177