ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

DVCS ? (All about Git, Mercurial-Hg and the like...)

<< < (23/39) > >>

ewemoa:
Just found the Index Editor feature.  IIUC, this allows one to not commit all changes in a file, but rather to choose portions (like git add -p?).  Commits can be more focused, so reviewing history can be easier...I think :)

Seems quite nice  :up:


Found the following documentation to be helpful:

  Staging, unstaging and the Index Editor


Possibly a (minor?) gotcha...

The documentation states:

Only the contents of the middle and the right editor can be modified. You can alter the contents of the Index either by editing the contents of the middle editor, or by moving chunks between the three editors. To do so, either click on the arrow and 'x' buttons between the editors, or click on the Take Left and Take Right buttons on the toolbar. After you're done, save your changes and close the Index Editor.

--- End quote ---

IIUC, the middle here represents the index and the right is the corresponding file in the working tree.  So I think that although it's called "Index Editor", one can also edit working tree content -- may be this can be convenient...

ewemoa:
Armando,

Did my first interactive rebase today -- great stuff  :up:

Wanted to see if SmartGit has some nice GUI for it and found:

  http://smartgit.3668570.n2.nabble.com/Interactive-rebasing-td7572897.html

Don't know if there's anything there yet -- have you come across anything?

ewemoa:
FWIW, it looks like there is some kind of stash support (at least in the 2.x series):
-ewemoa (May 16, 2011, 11:12 PM)
--- End quote ---

Spent some time trying to figure out how to view stash content -- perhaps the following may be helpful for someone else.

IIUC to view the content of a stash, open the log view (Control+L here), and find rows corresponding to a stash:

DVCS ? (All about Git, Mercurial-Hg and the like...)

The left highlighted section shows two rows:

  The row beginning with text "On master" appears to represent tracked file changes in a particular stash.

  The row beginning with text "untracked files" appears to represent untracked files for the same stash.

By selecting one or the other row, other areas of the UI change correspondingly (e.g. the Files tab -- the right highlighted area in the image).  Subsequent examination of appropriate areas of the UI appear to let one determine what is in a particular stash.

For reference, this was in a 3.x series SmartGit client.

Armando:
Hi ewemoa,

Thanks for your nice example ! Git is fun, isn't it ?

I've been using the index editor and stashing capabilities quite a bit in the last 1.5 year. Rebase, not as much. Maybe because I'm mostly working on my own, I don't mind having a few meaningless commits. I haven't looked for rebase interactive in the new SmartGit ; but, as you say, it doesn't seem to be implemented yet. Should be soon as the developer mentioned an available preview in October.

Apart from that, yes, stashing can be extremely useful. E.g. for those times where I find a bug that should be fixed before pursuing some coding : stash the current work, do the bug fixing, come back to previous coding by reapplying stash.

You mentioned renaming in a previous post. I still use the command line when I want to do an explicit file rename. But I usually don't have to as Git detects those if you're careful not committing renames with a bunch of other changes.

--

SmartGit proved to be quite user friendly, stable and helpful. Used it almost exclusively, together with TortoiseGit which has some great features implementations too (I especially like the fact that I can select and copy commits from the log view and I'll get a nice clean copy of all of them, with the comments... I use that for quickly creating reports). Also, SmartGit now supports Hg, which is a good thing for those of us who use mercurial !

ewemoa:
Thanks for the response :)

Git is fun, isn't it ?
-Armando (November 26, 2012, 09:27 AM)
--- End quote ---

He he -- once I figure out how to do something I'm stuck on, perhaps so.

Rebase, not as much. Maybe because I'm mostly working on my own, I don't mind having a few meaningless commits.

--- End quote ---

I take the log rewriting features to be a longer term investment -- for those days when I don't remember so well what was done before (wait...isn't that most days?).

One of the benefits I'm experiencing through the use of DVCS has to do with reviewing code -- at commit time, when viewing the log, etc.  I find it tends to uncover opportunities for improvement.  When one's log consists of commits that are easy to understand and are focused, I find the reviewing tends to be easier.  I am guessing that modifying past commits can aid in this process.

Apart from that, yes, stashing can be extremely useful. E.g. for those times where I find a bug that should be fixed before pursuing some coding : stash the current work, do the bug fixing, come back to previous coding by reapplying stash.

--- End quote ---

Definitely seems like a good time to use stashing.

What I've been using it mostly for is the following sort of situation:


* Working on feature A
* Realize I need feature B
* Stash feature A work
* Implement feature B and test
* Commit feature B and test
* Apply saved stash to continue work on A
Before learning how to use the stash, I was using the Index Editor to selectively commit -- but I've found that after one accumulates enough changes, picking out the relevant bits can become error-prone and overwhelming.  He he...I need better planning too.

Still trying to develop the habit of pausing to stash before starting work on something unexpected though.

You mentioned renaming in a previous post. I still use the command line when I want to do an explicit file rename. But I usually don't have to as Git detects those if you're careful not committing renames with a bunch of other changes.

--- End quote ---

I use the GUI but manually remove and add.  Still seems like it'd be nice if there were explicit support for renaming!

SmartGit proved to be quite user friendly, stable and helpful. Used it almost exclusively, together with TortoiseGit which has some great features implementations too (I especially like the fact that I can select and copy commits from the log view and I'll get a nice clean copy of all of them, with the comments... I use that for quickly creating reports). Also, SmartGit now supports Hg, which is a good thing for those of us who use mercurial !

--- End quote ---

It's nice to have that Hg support  :up:

As I try hard not to use applications that modify the registry, I have not really used TortoiseGit -- a pity, as it seems so nice.  I wonder if there's a way to get it to work with 3rd party Explorer alternatives...


Apart from interactive rebasing via the command line, I've been using magit in Emacs a bit.  Once I got the hang of the UI idea, I've been finding it to be pretty decent.

FWIW, the following screencast was very helpful in getting started:

  Meet Magit

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version