Let's say I have a project folder open in TM. The folder has already been initialized with Git, and all the files that are supposed to be under source control have been added. Let's further say that I've made some changes to the files "sample.html" and "sample.css," and it's time for a commit. The sample.css file is the current tab and is the file I've been editing most recently. I hit Control-Shift-G, the Git command menu pops up, and I choose Commit. Up pops a browser/message window with the words
Committing Files in ‘sample.css’ on branch ‘master’
In front of that is a two-paned window. The top pane has a place for me to type in the commit message, and the bottom shows a list of files to commit. Even though I've changed both sample.html and sample.css, only sample.css is in that list.
If I click in the project drawer before pressing Control-Shift-G, things work the way I think they should: The browser/message window says
Committing Files in ‘./’ on branch ‘master’
and the two-paned window has both files in the list of files to commit.
Is there a way (apart from clicking in the project drawer) to get the commit to apply to the entire project instead of just the frontmost tab?
On 10 Mar 2009, at 19:46, Dr. Drang wrote:
[...] I choose Commit. Up pops a browser/message window with the words
Committing Files in ‘sample.css’ on branch ‘master’
If I click in the project drawer before pressing Control-Shift-G, things work the way I think they should [...]
Is there a way (apart from clicking in the project drawer) to get the commit to apply to the entire project instead of just the frontmost tab?
I forked the bundle and made changes to what diff and commit work on: http://github.com/sorbits/git-tmbundle/commit/0b01a934787c30282ccd8a21e527d4...
Allan, Dr. Drang,
FWIW, the Subversion bundle works exactly the same way. If you commit from a text file, it only tries to commit said text file; if you want to commit a folder or the whole project, you have to click the appropriate place in the project pane.
So the git bundle behaves just like the Subversion bundle, which is both good because it's consistent and bad because obviously people get confused (I got confused by that, too). Whatever changes you make to the git bundle, should also be made to the Subversion bundle or else you end up with the versioning bundles behaving all differently.
That said, I'd suggest something else - why not make the menu item "commit" automatically commit the whole project and add a new menu item "commit this file only"? I figure most people will want to commit all pending changes at once most of the time, and if you need to only commit the single file, you can still do so.
Any thoughts from the list?
Thorsten
On 11 Mar 2009, at 08:31, Thorsten Hamann wrote:
FWIW, the Subversion bundle works exactly the same way. If you commit from a text file, it only tries to commit said text file; if you want to commit a folder or the whole project, you have to click the appropriate place in the project pane.
But if you have no selection in the project drawer, the Subversion bundle commits the entire project. This is also what my patch to the Git bundle introduces.
That said, I'd suggest something else - why not make the menu item "commit" automatically commit the whole project and add a new menu item "commit this file only"? I figure most people will want to commit all pending changes at once most of the time, and if you need to only commit the single file, you can still do so.
As I wrote in the commit message for the patch I linked to, with the behavior I introduced in the Git bundle, and the current Subversion bundle behavior, you press ⌃⌘R first (to select the current file) then commit (which commits just that single file).
The behavior about using selection in drawer, falling back on project folder, falling back on current file, is the way I want all bundles to behave. Though I have not made any serious effort to advocate it since in 1.x you have to manually unselect the file for this to be ideal (or have the folder with the file you switch to collapsed), but in 2.0 TM won’t do any automatic selection in the file browser, making this suggested behavior rational.
Allan Odgaard schrieb:
On 11 Mar 2009, at 08:31, Thorsten Hamann wrote:
FWIW, the Subversion bundle works exactly the same way. If you commit from a text file, it only tries to commit said text file; if you want to commit a folder or the whole project, you have to click the appropriate place in the project pane.
But if you have no selection in the project drawer, the Subversion bundle commits the entire project. This is also what my patch to the Git bundle introduces.
So obviously there are people who edit a bunch of files without ever touching the project drawer. I'm still in the process of getting used to Apple-T, so if I work on a project, I've likely clicked onto the active file in order to open or focus it. That way I didn't stumble upon the behaviour you describe.
The behavior about using selection in drawer, falling back on project folder, falling back on current file, is the way I want all bundles to behave. Though I have not made any serious effort to advocate it since in 1.x you have to manually unselect the file for this to be ideal (or have the folder with the file you switch to collapsed), but in 2.0 TM won’t do any automatic selection in the file browser, making this suggested behavior rational.
After the great current version, I'm really looking forward to 2.0, thanks for elaborating on details of how it's going to work internally. :)
Is there any way of signing up for beta testing it?
Thorsten
I think I now understand my earlier problem. Selecting a file to edit by clicking on its name in the project drawer selects that file for any later Commit action. Once a file is selected, changing to another file by any means--clicking on its name in the file drawer, clicking on its tab, using Command-<digit>, using Option-Command-<arrow>, or selecting it from the Command-T list--will select the new file in the project drawer, and now Commits will be focused on that file.
I didn't realize any of this before; the subtlety that Allan corrected was way over my head.
So as I now understand it, the only way to keep Commit working on the entire folder (at present, my git repos have no subdirectories) is to select the folder in the project drawer and then move from file to file via the tabs or the various Command key shortcuts, as those are the only ways to change the frontmost file without changing the selection in the project drawer.
I'm with Thorsten; it isn't intuitive to me that using different ways of selecting a file for editing should have an effect on the Commit command.