# [PATCH 1/2] must_commit_first: Make sure the index is up to date

8 messages from 2008-07-08 to 2008-07-08. Participants: Theodore Ts'o, Josef 'Jeff' Sipek, Junio C Hamano.
Thread: https://gitlist.dev/t/14333

## Theodore Ts'o, 2008-07-08 00:03

Subject: Two quick patches for guilt v0.30
Message-ID: <1215475392-26221-1-git-send-email-tytso@mit.edu>
URL: https://gitlist.dev/e/1215475392-26221-1-git-send-email-tytso%40mit.edu

```
Hi Jeff, here are two quick patches for guilt, versus v0.30.  The
second is needed for people using the latest git (on the master
branch), so it'd be great if you could get this out.

Thanks, regards,

					- Ted

```

## Theodore Ts'o, 2008-07-08 00:03

Subject: [PATCH 1/2] must_commit_first: Make sure the index is up to date
Message-ID: <1215475392-26221-2-git-send-email-tytso@mit.edu>
URL: https://gitlist.dev/e/1215475392-26221-2-git-send-email-tytso%40mit.edu
In-Reply-To: <1215475392-26221-1-git-send-email-tytso@mit.edu>

```
git diff-files can be confused if the index is not up to date, so make
sure it is updated first.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 guilt |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/guilt b/guilt
index 50414a4..cdf4e9b 100755
--- a/guilt
+++ b/guilt
@@ -495,6 +495,7 @@ s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\(
 # usage: must_commit_first
 must_commit_first()
 {
+	git update-index --refresh --unmerged -q > /dev/null
 	[ `git diff-files | wc -l` -eq 0 ]
 	return $?
 }
-- 
1.5.6.1.205.ge2c7.dirty

```

## Theodore Ts'o, 2008-07-08 00:03

Subject: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <1215475392-26221-3-git-send-email-tytso@mit.edu>
URL: https://gitlist.dev/e/1215475392-26221-3-git-send-email-tytso%40mit.edu
In-Reply-To: <1215475392-26221-2-git-send-email-tytso@mit.edu>

```
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 guilt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/guilt b/guilt
index cdf4e9b..d30d35a 100755
--- a/guilt
+++ b/guilt
@@ -23,7 +23,7 @@ esac
 # we change directories ourselves
 SUBDIRECTORY_OK=1
 
-. git-sh-setup
+. $(git --exec-path)/git-sh-setup
 
 #
 # Git version check
-- 
1.5.6.1.205.ge2c7.dirty

```

## Josef 'Jeff' Sipek, 2008-07-08 00:32

Subject: Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <20080708003256.GB1880@josefsipek.net>
URL: https://gitlist.dev/e/20080708003256.GB1880%40josefsipek.net
In-Reply-To: <1215475392-26221-3-git-send-email-tytso@mit.edu>

```
On Mon, Jul 07, 2008 at 08:03:12PM -0400, Theodore Ts'o wrote:
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> ---
>  guilt |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/guilt b/guilt
> index cdf4e9b..d30d35a 100755
> --- a/guilt
> +++ b/guilt
> @@ -23,7 +23,7 @@ esac
>  # we change directories ourselves
>  SUBDIRECTORY_OK=1
>  
> -. git-sh-setup
> +. $(git --exec-path)/git-sh-setup

This seems wrong.


jeffpc@freyr:~$ git --version
git version 1.5.6.2.247.g923712
jeffpc@freyr:~$ git --exec-path
/home/jeffpc/git-bin/bin

AFAICT, it should be:

/home/jeffpc/git-bin/libexec/git-core

(which contains git-sh-setup)

Josef 'Jeff' Sipek.

-- 
I think there is a world market for maybe five computers.
		- Thomas Watson, chairman of IBM, 1943.

```

## Junio C Hamano, 2008-07-08 00:56

Subject: Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <7vwsjxxkfd.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwsjxxkfd.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080708003256.GB1880@josefsipek.net>

```
"Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:

> On Mon, Jul 07, 2008 at 08:03:12PM -0400, Theodore Ts'o wrote:
>> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
>> ---
>>  guilt |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/guilt b/guilt
>> index cdf4e9b..d30d35a 100755
>> --- a/guilt
>> +++ b/guilt
>> @@ -23,7 +23,7 @@ esac
>>  # we change directories ourselves
>>  SUBDIRECTORY_OK=1
>>  
>> -. git-sh-setup
>> +. $(git --exec-path)/git-sh-setup
>
> This seems wrong.
>
> jeffpc@freyr:~$ git --version
> git version 1.5.6.2.247.g923712
> jeffpc@freyr:~$ git --exec-path
> /home/jeffpc/git-bin/bin

Hmm, it is yours that look wrong.

With 1.6.0 preview (aka 'master'):

$ git --version
git version 1.5.6.2.255.gbed62
$ git --exec-path
/home/junio/git-master/libexec/git-core

With 1.5.6 maintenance track (aka 'maint'):

$ ~/git-maint/bin/git --version
git version 1.5.6.2.15.g39f31
$ ~/git-maint/bin/git --exec-path
/home/junio/git-maint/bin

```

## Josef 'Jeff' Sipek, 2008-07-08 01:14

Subject: Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <20080708011413.GC1880@josefsipek.net>
URL: https://gitlist.dev/e/20080708011413.GC1880%40josefsipek.net
In-Reply-To: <7vwsjxxkfd.fsf@gitster.siamese.dyndns.org>

```
On Mon, Jul 07, 2008 at 05:56:54PM -0700, Junio C Hamano wrote:
> "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:
...
> > jeffpc@freyr:~$ git --version
> > git version 1.5.6.2.247.g923712
> > jeffpc@freyr:~$ git --exec-path
> > /home/jeffpc/git-bin/bin
> 
> Hmm, it is yours that look wrong.
 
Ok.

> With 1.6.0 preview (aka 'master'):
> 
> $ git --version
> git version 1.5.6.2.255.gbed62

A fresh clone (from master.kernel.org over ssh) gets me:

$ git describe
v1.5.6.2-247-g9237122
$ git --version
git version 1.5.6.GIT
$ git --exec-path
/home/jeffpc/git-bin/bin

You seem to have a different HEAD for the master branch than I do.

Josef 'Jeff' Sipek.

-- 
Don't drink and derive. Alcohol and algebra don't mix.

```

## Junio C Hamano, 2008-07-08 01:17

Subject: Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <7viqvhxjhc.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7viqvhxjhc.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080708011413.GC1880@josefsipek.net>

```
"Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:

> A fresh clone (from master.kernel.org over ssh) gets me:
>
> $ git describe
> v1.5.6.2-247-g9237122
> $ git --version
> git version 1.5.6.GIT
> $ git --exec-path
> /home/jeffpc/git-bin/bin
>
> You seem to have a different HEAD for the master branch than I do.

Oh, my private 'master' almost always is ahead of the public one after
work.

But I do not have any new changes around this area lately.  Promise ;-).

```

## Josef 'Jeff' Sipek, 2008-07-08 01:28

Subject: Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path
Message-ID: <20080708012829.GD1880@josefsipek.net>
URL: https://gitlist.dev/e/20080708012829.GD1880%40josefsipek.net
In-Reply-To: <7viqvhxjhc.fsf@gitster.siamese.dyndns.org>

```
On Mon, Jul 07, 2008 at 06:17:19PM -0700, Junio C Hamano wrote:
> "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:
> 
> > A fresh clone (from master.kernel.org over ssh) gets me:
> >
> > $ git describe
> > v1.5.6.2-247-g9237122
> > $ git --version
> > git version 1.5.6.GIT
> > $ git --exec-path
> > /home/jeffpc/git-bin/bin
> >
> > You seem to have a different HEAD for the master branch than I do.
> 
> Oh, my private 'master' almost always is ahead of the public one after
> work.
> 
> But I do not have any new changes around this area lately.  Promise ;-).

Heh.

Alright, mystery solved. I had a GIT_EXEC_PATH set. Removing it from my
bash_profile makes everything work just fine.

Sorry for the noise.

Jeff.

-- 
Penguin : Linux version 2.6.25.4 on an i386 machine (6135.77 BogoMips).

```
