Skip to contentSkip to conversation

git-gui console app ?

DISCUSSION Erik Colson 7 participants 14 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello !

git-gui is a nice application and I like to use it while developping. However as probably a lot of developpers do, I regularly code in Emacs from a distant ssh client.
Therefor I'd want to find some app like git-gui running in console... Does this exist or is there a project in development ?

Thanks for info

Signature · 1 line
Erik
#1 lore raw

Hi,

Quoted 5 lines · Erik Colson

git-gui is a nice application and I like to use it while developping. However as probably a lot of developpers do, I regularly code in Emacs from a distant ssh client.
Therefor I'd want to find some app like git-gui running in console... Does this exist or is there a project in development ?

There is tig. http://repo.or.cz/w/tig.git

It is something similar to gitk but based on curses, so it is a viewer for now. But I do not see any fundamental reason why it should not be possible to teach it many of the tricks git-gui does.

Just fork it (you can even do that on repo.or.cz; tig.git is mirrored there), and give it a go!

Ciao,
Dscho

#2 lore raw
Quoted 10 lines · Johannes Schindelin

Hi,

Quoted 5 lines · Erik Colson

git-gui is a nice application and I like to use it while developping. However as probably a lot of developpers do, I regularly code in Emacs from a distant ssh client.
Therefor I'd want to find some app like git-gui running in console... Does this exist or is there a project in development ?

Quoted 8 lines

There is tig. http://repo.or.cz/w/tig.git

It is something similar to gitk but based on curses, so it is a viewer for now. But I do not see any fundamental reason why it should not be possible to teach it many of the tricks git-gui does.

Just fork it (you can even do that on repo.or.cz; tig.git is mirrored there), and give it a go!

Thanks for the very fast answer. I'm currently trying it out. However I can't figure out how to view the 'changed but not updated' in diff format...
Any clue what I'm missing ?

Signature · 1 line
Erik
#3 lore raw
Quoted 3 lines · Erik Colson

Thanks for the very fast answer. I'm currently trying it out. However I can't figure out how to view the 'changed but not updated' in diff format...

git-diff ?

By default, it will show the changes between your working tree and the index (i.e., changed but not updated). You can show the diff of "updated but not commited" with "git-diff --cached".

-Peff

#4 lore raw
Quoted 11 lines · Jeff King
Quoted 3 lines · Erik Colson

Thanks for the very fast answer. I'm currently trying it out. However I can't figure out how to view the 'changed but not updated' in diff format...

git-diff ?

By default, it will show the changes between your working tree and the index (i.e., changed but not updated). You can show the diff of "updated but not commited" with "git-diff --cached".

Peff,

yep that is the info I would like to browse in a way git-gui does it... showing a list of the files in the diff, and letting the user select a file to show the part of the diff for that file.

Signature · 1 line
Erik
#5 lore raw
Quoted 7 lines · Erik Colson
Quoted 3 lines

By default, it will show the changes between your working tree and the index (i.e., changed but not updated). You can show the diff of "updated but not commited" with "git-diff --cached".

yep that is the info I would like to browse in a way git-gui does it... showing a list of the files in the diff, and letting the user select a file to show the part of the diff for that file.

Ah, I see. There is a status mode for tig (tig -S), but you can't jump to the diff of a particular file. It shouldn't be that difficult to add for somebody familiar with the tig codebase, but I am not such a somebody.

Jonas, am I right that this should be a one-liner? If you can point me in the right direction, I can try to take a closer look, but I'm having trouble following the code.

-Peff

#11 lore raw
In reply to Erik Colson
Quoted 13 lines · Erik Colson
Quoted 11 lines · Jeff King
Quoted 3 lines · Erik Colson

Thanks for the very fast answer. I'm currently trying it out. However I can't figure out how to view the 'changed but not updated' in diff format...

git-diff ?

By default, it will show the changes between your working tree and the index (i.e., changed but not updated). You can show the diff of "updated but not commited" with "git-diff --cached".

Quoted 5 lines

Peff,

yep that is the info I would like to browse in a way git-gui does it... showing a list of the files in the diff, and letting the user select a file to show the part of the diff for that file.

Since you are an Emacs user, perhaps contrib/emacs/* would be more to your taste?

#6 lore raw
In reply to Jeff King

Jeff King <[email protected]> wrote Sun, Aug 05, 2007:

Quoted 10 lines · Erik Colson
Quoted 8 lines
Quoted 4 lines

By default, it will show the changes between your working tree and the index (i.e., changed but not updated). You can show the diff of "updated but not commited" with "git-diff --cached".

yep that is the info I would like to browse in a way git-gui does it... showing a list of the files in the diff, and letting the user select a file to show the part of the diff for that file.

Quoted 8 lines

Ah, I see. There is a status mode for tig (tig -S), but you can't jump to the diff of a particular file. It shouldn't be that difficult to add for somebody familiar with the tig codebase, but I am not such a somebody.

Jonas, am I right that this should be a one-liner? If you can point me in the right direction, I can try to take a closer look, but I'm having trouble following the code.

Not quite a one-liner, but I've implemented something that will show diffs of staged/unstaged changes as well as the content of untracked files when pressing Enter on a file in the status view. To update the status of a file (unstaged->staged, untracked->staged, etc) you now have to press 'u'.

Hope this helps.

Signature · 1 line
Jonas Fonseca
#7 lore raw
Quoted 5 lines · Jonas Fonseca

Not quite a one-liner, but I've implemented something that will show diffs of staged/unstaged changes as well as the content of untracked files when pressing Enter on a file in the status view. To update the status of a file (unstaged->staged, untracked->staged, etc) you now have to press 'u'.

Nice. This was exactly what I had envisioned. Minor help text fixup is below.

-Peff

-- >8 --
status window: mention 'u' instead of Enter

Commits ca1d71ea and 89d917a bound the Enter functionality to 'u' (and Enter now shows the diff).

---
 tig.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
tig.c +3 -3
index d9c9df8..40670e2 100644
@@ -3156,15 +3156,15 @@ status_select(struct view *view, struct line *line)
 
 	switch (line->type) {
 	case LINE_STAT_STAGED:
-		text = "Press Enter to unstage file for commit";
+		text = "Press 'u' to unstage file for commit";
 		break;
 
 	case LINE_STAT_UNSTAGED:
-		text = "Press Enter to stage file for commit  ";
+		text = "Press 'u' to stage file for commit  ";
 		break;
 
 	case LINE_STAT_UNTRACKED:
-		text = "Press Enter to stage file for addition";
+		text = "Press 'u' to stage file for addition";
 		break;
 
 	case LINE_STAT_NONE:
Signature · 1 line
1.5.2.4
#8 lore raw

Jeff King <[email protected]> wrote Fri, Aug 10, 2007:

Quoted 10 lines · Jonas Fonseca
Quoted 6 lines

Not quite a one-liner, but I've implemented something that will show diffs of staged/unstaged changes as well as the content of untracked files when pressing Enter on a file in the status view. To update the status of a file (unstaged->staged, untracked->staged, etc) you now have to press 'u'.

Nice. This was exactly what I had envisioned. Minor help text fixup is below.

Thanks! I forgot to mention that I applied something like what you sent yesterday.

Signature · 1 line
Jonas Fonseca
#9 lore raw
In reply to Jonas Fonseca
Quoted 7 lines · Jonas Fonseca

Not quite a one-liner, but I've implemented something that will show diffs of staged/unstaged changes as well as the content of untracked files when pressing Enter on a file in the status view. To update the status of a file (unstaged->staged, untracked->staged, etc) you now have to press 'u'.

Hope this helps.

Works like a charm ! Thanks for the implementation. Btw, I'm using git (and tig) on MacosX and got it compiled by using the same remarks you mention for FreeBSD, so may be you could add this to the INSTALL document...

Signature · 1 line
Erik
#10 lore raw
Quoted 10 lines · Erik Colson
Quoted 7 lines · Jonas Fonseca

Not quite a one-liner, but I've implemented something that will show diffs of staged/unstaged changes as well as the content of untracked files when pressing Enter on a file in the status view. To update the status of a file (unstaged->staged, untracked->staged, etc) you now have to press 'u'.

Hope this helps.

Works like a charm ! Thanks for the implementation.

Good to hear.

Now, I have to figure out how to clone git-gui's ability to stage individual diff (c)hunks ... :)

Quoted 4 lines

Btw, I'm using
git (and tig) on MacosX and got it compiled by using the same remarks you mention for FreeBSD, so may be you could add this to the INSTALL document...

Yes, it might be a good idea to add it, but I would like to add a configure script to figure this sort of thing out automatically.

Signature · 1 line
Jonas Fonseca
#12 lore raw
In reply to Erik Colson
Quoted 7 lines · Erik Colson

Hello !

git-gui is a nice application and I like to use it while developping. However as probably a lot of developpers do, I regularly code in Emacs from a distant ssh client.
Therefor I'd want to find some app like git-gui running in console... Does this exist or is there a project in development ?

If you are already using emacs, why not use the emacs frontend? It isn't as featureful as git gui right now, but it integrates better with your emacs.

Signature · 1 line
David Kågedal
#13 lore raw
Quoted 3 lines · David Kågedal

If you are already using emacs, why not use the emacs frontend? It isn't as featureful as git gui right now, but it integrates better with your emacs.

I'm actually using git-status in Emacs. But I'd like to access repo diffs in a gui like tig. It's quite nice excepted that I can't figure out how to show the result of git-diff --cached

Signature · 1 line
Erik