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.
Summary: | Show number of incoming/outgoing changes from/to upstream in the versioning label of the project | ||
---|---|---|---|
Product: | versioncontrol | Reporter: | markiewb |
Component: | Git | Assignee: | Ondrej Vrabec <ovrabec> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | git |
Priority: | P3 | ||
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Windows 7 | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | 226364 | ||
Bug Blocks: | |||
Attachments: | Shows working state in NetBeans IDE Dev (Build 201507240001) |
Description
markiewb
2013-02-06 10:23:38 UTC
Typo: Another usecase: Using this incoming commits information the user will be aware that there is a pull (+merge) required before pushing) You could also show this information in the "git repository browser" tc. > Implementation seems to be simple. Use the > org.eclipse.jgit.lib.BranchTrackingStatus from the jgit-module to calculate the > numbers. > <pre> > JGitRepository jGitRepository = new JGitRepository(repoDir); > BranchTrackingStatus of = > BranchTrackingStatus.of(jGitRepository.getRepository(), "master"); > System.out.println("of = " + of.getRemoteTrackingBranch()); > System.out.println("ahead = " + of.getAheadCount()); > System.out.println("behind = " + of.getBehindCount()); > </pre> Not sure that is what you expect. I am afraid this returns the difference (+/- commits) between the branch and the one in remotes/origin/. In other words you will need to have all commits already on your local machine (you must have run a fetch). This is BTW already implemented and you can observe it in the repository browser. The tooltip on a branch (Branches/Local) displays such information. But what you probably need is the real difference between your local branch and its tracked branch in the remote repository. But for that we'd need to periodically contact the remote repository (run a fetch) which may be undesirable. I guess a switch or an option to enable/disable suh a feature could be added. > IMHO the info should also be filtered by the current node. That means when > there is a repo with 10 projects, please show only the in/out info which is > related the currently project node directory - not for the whole repo. What do you mean? If you have several projects in a single repository then all of them are on the same branch. I do not understand what should we filter. > ProjectA [master +2] > ProjectB [master +2] > ProjectC [master +2] ... in/out info is always the same, isn't it? Please make an example so i understand what you meant. (In reply to comment #3) > But what you probably need is the real difference between your local branch and > its tracked branch in the remote repository. But for that we'd need to > periodically contact the remote repository (run a fetch) which may be > undesirable. I guess a switch or an option to enable/disable suh a feature > could be added. Yes, that is my request. You could make it switchable when implementation customable label decorators for git (currently not available, but for hq/cvs). The user could decide which text decorations he wants and thats the toggle. > What do you mean? If you have several projects in a single repository then all > of them are on the same branch. I do not understand what should we filter. > > ProjectA [master +2] > > ProjectB [master +2] > > ProjectC [master +2] > ... in/out info is always the same, isn't it? Please make an example so i > understand what you meant. For example: A,B,C are in the same repo. If there is a incoming change in project B show the information at node of project B only. But not for project A nor C. Does it make sense? See also the original request and impl for egit: http://git.eclipse.org/c/egit/egit.git/commit?id=a15b717a4b9138fb4d11fc07a26e9f9979b0562f (In reply to comment #4) > Yes, that is my request. You could make it switchable when implementation > customable label decorators for git (currently not available, but for hq/cvs). > The user could decide which text decorations he wants and thats the toggle. FYI: customizable status decorators for git are requested by http://netbeans.org/bugzilla/show_bug.cgi?id=226364 (In reply to Ondrej Vrabec from comment #3) I'd love to see the decoration, as well (one of the few things I like about egit). However, I'd prefer it to behave same as the tool tip in the repo browser (simply more convenient). Having NB doing unrequested fetches isn't something I'd like. I'd just like a clear and obvious indication that the local branch state has diverged from the local notion of the upstream state. BTW - I didn't know about the tool tip in the repo browser. Thanks for that. Not nearly as visible as a project tree decoration, but still useful. (In reply to sindisil from comment #7) > (In reply to Ondrej Vrabec from comment #3) > I'd love to see the decoration... So please vote! (In reply to markiewb from comment #8) > (In reply to sindisil from comment #7) > > (In reply to Ondrej Vrabec from comment #3) > > I'd love to see the decoration... > > So please vote! Sorry. Undo. You already voted... How is this request going ? It would be so usefull to see if my local repo si not updated with my remote repo. decided to do it this way: - no automatic fetches or connections to remote repositories - just showing info about the sync status with remote tracking branches. e.g.: master is ahead of origin/master by 2 commits => shows [master O2] e.g.: master is behind origin/master by 2 commits => shows [master I2] e.g.: master needs merge with origin/master => shows [master O2 I2] all this will be available only if you do periodical fetches (you must fetch commits from the remote repository manually). Last note: to get this working make sure that Tools -> Options -> Team -> Versioning -> Git | Project Node Format contains "{tracking_status}" variable Sorry it took so long, any feedback is welcome. fixed: core-main #222698b695c8 Integrated into 'main-silver', will be available in build *201502090001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/222698b695c8 User: Ondrej Vrabec <ovrabec@netbeans.org> Log: Issue #225787 - Show number of incoming/outgoing changes from/to upstream in the versioning label of the project I tested it in the latest dev build (201507200001) but this doesn't show it to me :/. I added the variable to the team -> git options. I only see the branch. Nothing more. Show incoming/outgoing works, when I call it. Created attachment 154861 [details] Shows working state in NetBeans IDE Dev (Build 201507240001) (In reply to ChrisLE from comment #13) > I tested it in the latest dev build (201507200001) but this doesn't show it > to me :/. I added the variable to the team -> git options. I only see the > branch. Nothing more. Show incoming/outgoing works, when I call it. @ChrisLE: It works for me. Try to commit something and NB will show you that you are ahead. See screenshot |