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 250830 - Show common ancestor in git history
Summary: Show common ancestor in git history
Status: NEW
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 8.0.2
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-02 17:19 UTC by hifi
Modified: 2015-03-02 20:44 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hifi 2015-03-02 17:19:34 UTC
While the feature in bug 221662 is probably not going to get implemented very soon, I'm suggesting this as a quick fix for the problem of not having any ancestor context in a branch history view making Netbeans completely useless when trying to understand branch history.

The history view already has tags of branches that are at the exact commits in the same history (on left side of revision), like so:

[origin/master] [master] [HEAD] 123abcd

This is fine when you are viewing the most recent branch/head. However, when you view something that has differed from the master history for example, you don't have any indication of at what point the split has happened and from what branch it was branched off.

Something like this in the visible history of any branch would be handy and easy to implement visually (no new components required), in this case the current branch is [test] which is at revision "C" while master is at revision "C" and the first commit was "A". I added the new "tags" on the right side of the revision to have them separated from current tags.

[test] C
I made a commit to new branch!
---

A [master +1 commit]
The first commit
---

This would indicate to the developer that the common ancestor "A" is from master branch and the actual branch is 1 commit (commit B, not visible in this history) ahead of the branching point. This visualizes enough for most where branching has started without needing to compare two history logs and visually searching for the common ancestor or using an external history tool.

Ideally this would work for any branch so you could see many other branches with common ancestors in the same flat list if they have the same common one, like so:

A [master +1 commit] [cool-feature +5 commits]
The first commit
---

However, if "cool-feature" in this case would have been branched off "B" which is not common to "test" it would not be in the history log as the commit doesn't exist there. It would only be shown in "master" history where the top commit is "B" and "cool-feature" is ahead 4 of that.

Was this clear enough? Doable? :)
Comment 1 hifi 2015-03-02 17:23:59 UTC
Master was supposed to be at commit "B" and not "C".
Comment 2 Ondrej Vrabec 2015-03-02 19:48:59 UTC
This gets really messy when number of existing branches grows. Not sure how i could display such information for lets say even that few as 10 branches.
Plus unfortunately the information about a commit belonging to a branch (reachable from the branch's HEAD) is non-trivial and computation expensive.
Comment 3 hifi 2015-03-02 20:44:42 UTC
(In reply to Ondrej Vrabec from comment #2)
> This gets really messy when number of existing branches grows. Not sure how
> i could display such information for lets say even that few as 10 branches.
> Plus unfortunately the information about a commit belonging to a branch
> (reachable from the branch's HEAD) is non-trivial and computation expensive.

Now that I think of it from data structure perspective you're right, it's not trivial to walk back every branch to find a common ancestor without adding custom metadata. Possibly have an option to have a default branch to compare against which would default to "master"?

Or a tool to "Compare against..." and you could select a branch and it would show you the differing history from the common ancestor? That would automate the manual process. The view could still be the same as described, so you'll get a hint how much difference are there commit count wise. That's basically like doing a merge but a dry run to see the history difference.

This is still different from the full tree view but it would help understanding branch relations without one as now you lose the full context every time you branch off and view history when the originating branch has advanced.