threads / patch / 14333

patch, 2 partsmust_commit_first: Make sure the index is up to date

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

## tl;dr

8 messages between Jul 8, 2008 and Jul 8, 2008. Diffs are folded; open one to read it.

replies: 7people: 3as markdown or json

Theodore Ts'o· Jul 8, 2008, 00:03 UTC · lore

Two quick patches for guilt v0.30

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· Jul 8, 2008, 00:03 UTC · re: Theodore Ts'o · lore

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(-)
Show changes to guilt +1 −0
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· Jul 8, 2008, 00:03 UTC · re: Theodore Ts'o · lore

[PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
---
 guilt |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to guilt +1 −1
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· Jul 8, 2008, 00:32 UTC · re: Theodore Ts'o · lore

Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

On Mon, Jul 07, 2008 at 08:03:12PM -0400, Theodore Ts'o wrote:
Show 15 quoted lines
> 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· Jul 8, 2008, 00:56 UTC · re: Josef 'Jeff' Sipek · lore

Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

"Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:
Show 23 quoted lines
> 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· Jul 8, 2008, 01:14 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

On Mon, Jul 07, 2008 at 05:56:54PM -0700, Junio C Hamano wrote:
> "Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:
...
Show 6 quoted lines
> > 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· Jul 8, 2008, 01:17 UTC · re: Josef 'Jeff' Sipek · lore

Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

"Josef 'Jeff' Sipek" <jeffpc@josefsipek.net> writes:
Show 10 quoted lines
> 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· Jul 8, 2008, 01:28 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/2] Make guilt work even after git-sh-setup is moved out of the user's path

On Mon, Jul 07, 2008 at 06:17:19PM -0700, Junio C Hamano wrote:
Show 17 quoted lines
> "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).

← back to recent threads