# git-gui console app ?

14 messages from 2007-08-04 to 2007-08-11. Participants: Erik Colson, Johannes Schindelin, Jeff King, Junio C Hamano, David Kågedal, Jonas Fonseca.
Thread: https://gitlist.dev/t/9378

## Erik Colson, 2007-08-04 10:10

Subject: git-gui console app ?
Message-ID: <20070804101058.GA520@Mac2.local>
URL: https://gitlist.dev/e/20070804101058.GA520%40Mac2.local

```
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

-- 
Erik

```

## Johannes Schindelin, 2007-08-04 11:29

Subject: Re: git-gui console app ?
Message-ID: <Pine.LNX.4.64.0708041225520.14781@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0708041225520.14781%40racer.site
In-Reply-To: <20070804101058.GA520@Mac2.local>

```
Hi,

On Sat, 4 Aug 2007, Erik Colson wrote:

> 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

```

## Erik Colson, 2007-08-04 11:53

Subject: Re: git-gui console app ?
Message-ID: <20070804115331.GA2962@Mac2.local>
URL: https://gitlist.dev/e/20070804115331.GA2962%40Mac2.local
In-Reply-To: <Pine.LNX.4.64.0708041225520.14781@racer.site>

```
On Sat, Aug 04, 2007 at 12:29:03PM +0100, Johannes Schindelin wrote:
> Hi,
> 
> On Sat, 4 Aug 2007, Erik Colson wrote:
> 
> > 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!

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 ?

-- 
Erik

```

## Jeff King, 2007-08-04 12:03

Subject: Re: git-gui console app ?
Message-ID: <20070804120342.GC9716@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20070804120342.GC9716%40coredump.intra.peff.net
In-Reply-To: <20070804115331.GA2962@Mac2.local>

```
On Sat, Aug 04, 2007 at 01:53:31PM +0200, Erik Colson wrote:

> 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

```

## Erik Colson, 2007-08-04 12:38

Subject: Re: git-gui console app ?
Message-ID: <20070804123834.GA3036@Mac2.local>
URL: https://gitlist.dev/e/20070804123834.GA3036%40Mac2.local
In-Reply-To: <20070804120342.GC9716@coredump.intra.peff.net>

```
On Sat, Aug 04, 2007 at 08:03:42AM -0400, Jeff King wrote:
> On Sat, Aug 04, 2007 at 01:53:31PM +0200, Erik Colson wrote:
> 
> > 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.

-- 
Erik

```

## Junio C Hamano, 2007-08-04 18:38

Subject: Re: git-gui console app ?
Message-ID: <7vhcnfgn6s.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhcnfgn6s.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070804123834.GA3036@Mac2.local>

```
Erik Colson <eco@ecocode.net> writes:

> On Sat, Aug 04, 2007 at 08:03:42AM -0400, Jeff King wrote:
>> On Sat, Aug 04, 2007 at 01:53:31PM +0200, Erik Colson wrote:
>> 
>> > 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.

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

```

## Jeff King, 2007-08-05 10:19

Subject: Re: git-gui console app ?
Message-ID: <20070805101953.GI12507@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20070805101953.GI12507%40coredump.intra.peff.net
In-Reply-To: <20070804123834.GA3036@Mac2.local>

```
On Sat, Aug 04, 2007 at 02:38:34PM +0200, Erik Colson wrote:

> > 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

```

## David Kågedal, 2007-08-07 14:21

Subject: Re: git-gui console app ?
Message-ID: <87k5s7e88d.fsf@morpheus.local>
URL: https://gitlist.dev/e/87k5s7e88d.fsf%40morpheus.local
In-Reply-To: <20070804101058.GA520@Mac2.local>

```
Erik Colson <eco@ecocode.net> writes:

> 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.

-- 
David Kågedal

```

## Erik Colson, 2007-08-07 15:18

Subject: Re: git-gui console app ?
Message-ID: <20070807151831.GB6717@Mac2.local>
URL: https://gitlist.dev/e/20070807151831.GB6717%40Mac2.local
In-Reply-To: <87k5s7e88d.fsf@morpheus.local>

```
On Tue, Aug 07, 2007 at 04:21:06PM +0200, David Kågedal wrote:
> 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

-- 
Erik

```

## Jonas Fonseca, 2007-08-10 13:31

Subject: Re: git-gui console app ?
Message-ID: <20070810133132.GA3770@diku.dk>
URL: https://gitlist.dev/e/20070810133132.GA3770%40diku.dk
In-Reply-To: <20070805101953.GI12507@coredump.intra.peff.net>

```
Jeff King <peff@peff.net> wrote Sun, Aug 05, 2007:
> On Sat, Aug 04, 2007 at 02:38:34PM +0200, Erik Colson wrote:
> 
> > > 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.

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.

-- 
Jonas Fonseca

```

## Jeff King, 2007-08-10 14:21

Subject: Re: git-gui console app ?
Message-ID: <20070810142104.GA10997@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20070810142104.GA10997%40sigill.intra.peff.net
In-Reply-To: <20070810133132.GA3770@diku.dk>

```
On Fri, Aug 10, 2007 at 03:31:32PM +0200, Jonas Fonseca wrote:

> 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).

Signed-off-by: Jeff King <peff@peff.net>
---
 tig.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tig.c b/tig.c
index d9c9df8..40670e2 100644
--- a/tig.c
+++ b/tig.c
@@ -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:
-- 
1.5.2.4

```

## Erik Colson, 2007-08-10 14:25

Subject: Re: git-gui console app ?
Message-ID: <20070810142540.GE363@Mac2.local>
URL: https://gitlist.dev/e/20070810142540.GE363%40Mac2.local
In-Reply-To: <20070810133132.GA3770@diku.dk>

```
On Fri, Aug 10, 2007 at 03:31:32PM +0200, Jonas Fonseca wrote:
> 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...

-- 
Erik

```

## Jonas Fonseca, 2007-08-11 10:11

Subject: Re: git-gui console app ?
Message-ID: <20070811101122.GB25053@diku.dk>
URL: https://gitlist.dev/e/20070811101122.GB25053%40diku.dk
In-Reply-To: <20070810142104.GA10997@sigill.intra.peff.net>

```
Jeff King <peff@peff.net> wrote Fri, Aug 10, 2007:
> On Fri, Aug 10, 2007 at 03:31:32PM +0200, Jonas Fonseca wrote:
> 
> > 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.

-- 
Jonas Fonseca

```

## Jonas Fonseca, 2007-08-11 10:22

Subject: Re: git-gui console app ?
Message-ID: <2c6b72b30708110322i53bb713fka6fe259b43a95b45@mail.gmail.com>
URL: https://gitlist.dev/e/2c6b72b30708110322i53bb713fka6fe259b43a95b45%40mail.gmail.com
In-Reply-To: <20070810142540.GE363@Mac2.local>

```
On 8/10/07, Erik Colson <eco@ecocode.net> wrote:
> On Fri, Aug 10, 2007 at 03:31:32PM +0200, Jonas Fonseca wrote:
> > 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 ... :)

> 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.

-- 
Jonas Fonseca

```
