Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 247552 - Commit... toolbar button commits only current active file
Commit... toolbar button commits only current active file
Status: RESOLVED FIXED
Product: versioncontrol
Classification: Unclassified
Component: Git
8.0.1
All All
: P3 (vote)
: 8.1
Assigned To: Ondrej Vrabec
issues@versioncontrol
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-09-29 11:45 UTC by hifi
Modified: 2014-10-05 07:07 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hifi 2014-09-29 11:45:47 UTC
When customizing your toolbars and adding Git functionality to them, the "Commit..." button opens up the commit dialog only for the current file.

This might be in par with the toolbar functions only to affect the current file context if such has been a design goal but it raises some confusion and possibly partial commits.

As there are many other buttons that affect the whole repository (like fetch/pull/push/diff to head/show history) and there are no alternative buttons to choose for full functionality, it should in my opinion be consistent with Team menu entries rather than only single file context.

I hope this could be discussed to get the best possible solution that works for everyone.
Comment 1 Ondrej Vrabec 2014-09-29 11:50:59 UTC
I am pretty much sure that it reacts to the current selection. So if you select a project in the Projects view and click on the button then it commits whole project. Or not?
Comment 2 hifi 2014-09-29 11:57:42 UTC
Ah, yes, you're right about that.

I find it somewhat confusing it uses the current selection for that as it will constantly change if you double click on a file in the source tree and have many open in tabs and switch between them, make modifications and then try to commit.

It isn't always clear (at least not to me) what the selection context is and that it even affected anything in this case.
Comment 3 Ondrej Vrabec 2014-09-29 11:59:52 UTC
All our actions work that way. Just pay attention to what's your current selection and check the commit dialog's title (it prints the selection there).
Comment 4 hifi 2014-09-29 12:06:02 UTC
Fair enough. Thank you.
Comment 5 hifi 2014-09-30 06:08:35 UTC
Actually, there is more to this issue.

I just noticed that when I change the tab or I open a new file with Alt-Shift-O the visible context still is the project in the Projects tree (or whatever was selected) but the commit button will now only take into account the current file. I need to re-click the project in the Projects tree even though it has focus to get full project context again.

This was probably why I got so confused to begin with as the context wasn't visible anywhere but it acted out like that.
Comment 6 hifi 2014-09-30 06:24:27 UTC
This can be generalized into "input focus moves from Projects into editor" and that also changes the whole context of what you are doing.

I thought that if I keep the selection in the Projects view on the project itself the context will always be the full project but the fact that the context switches to single file when you work on a file is very frustrating indeed.

Is this what everyone else expect the interface to do? There seems to be no way to keep the focus on the whole project at all times and always requires you to click on the projects tab/window to fix the context.

It would be more clear if the Projects view selection would follow your editor in this case but that would also be rather annoying I presume.

I should have not reopened the issue though, this is more of a question about the implied workflow in NetBeans and how it is viewed by someone who has mainly used VCS from command line or external utilities that always work in the full context of the repository.
Comment 7 Ondrej Vrabec 2014-09-30 07:31:56 UTC
(In reply to hifi from comment #6)
> This can be generalized into "input focus moves from Projects into editor"
> and that also changes the whole context of what you are doing.
> 
> I thought that if I keep the selection in the Projects view on the project
> itself the context will always be the full project but the fact that the
> context switches to single file when you work on a file is very frustrating
> indeed.
> 
> Is this what everyone else expect the interface to do? There seems to be no
> way to keep the focus on the whole project at all times and always requires
> you to click on the projects tab/window to fix the context.
Yes, this is how it works. If you switch to another component (editor, projects view, any other view) the global selection changes and commit reacts to that instead what was previously selected in the projects view. Only if you set focus back to the projects view the commit will work on the whole project.
> It would be more clear if the Projects view selection would follow your
> editor in this case but that would also be rather annoying I presume.
Sure, just mark View -> Synchronize Editor with Views. Then projects view selection will change on what is currently open in the editor area.

What you're probably looking for is another type of commit (and all the others) action such as "Commit All" or something that would automatically commit all changes from the repository, right?
Comment 8 hifi 2014-09-30 07:40:30 UTC
(In reply to Ondrej Vrabec from comment #7)
> > It would be more clear if the Projects view selection would follow your
> > editor in this case but that would also be rather annoying I presume.
> Sure, just mark View -> Synchronize Editor with Views. Then projects view
> selection will change on what is currently open in the editor area.

Ah, at least now I know what is currently happening which is better than without. Thanks for pointing that out.

> What you're probably looking for is another type of commit (and all the
> others) action such as "Commit All" or something that would automatically
> commit all changes from the repository, right?

Yes, it would be ideal to have "* All" project buttons available. Preferably all buttons that can have context as you said so I could build up a toolbar that does exactly what I need.

For example "Diff to HEAD" as "Diff All to HEAD" would couple with the feature requested in bug 247366 beautifully and really improve my workflow on NetBeans.
Comment 9 Ondrej Vrabec 2014-10-03 11:42:31 UTC
fixed: core-main #c89b9136fbf3
Comment 10 Quality Engineering 2014-10-05 02:04:49 UTC
Integrated into 'main-silver', will be available in build *201410050001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/c89b9136fbf3
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #247552 - Commit... toolbar button commits only current active file
Adding repository-level versions of toolbar git actions.
Comment 11 hifi 2014-10-05 07:07:40 UTC
I've downloaded the latest nightly and tested the functionality to work as expected.

Thank you.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo