# [PATCH 1/2] git-gui: Fix a loose/lose mistake

6 messages from 2012-08-18 to 2012-09-17. Participants: Beat Bolli, Junio C Hamano, Pat Thoyts.
Thread: https://gitlist.dev/t/31277

## Beat Bolli, 2012-08-18 09:07

Subject: [PATCH 1/2] git-gui: Fix a loose/lose mistake
Message-ID: <1345280851-6626-1-git-send-email-bbolli@ewanet.ch>
URL: https://gitlist.dev/e/1345280851-6626-1-git-send-email-bbolli%40ewanet.ch

```
No po update needed, as this string is untranslated.

Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
---
 git-gui/lib/commit.tcl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
index 0d81432..78c5eeb 100644
--- a/git-gui/lib/commit.tcl
+++ b/git-gui/lib/commit.tcl
@@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} {
 	    && 	[is_config_true gui.warndetachedcommit]} {
 		set msg [mc "You are about to commit on a detached head.\
 This is a potentially dangerous thing to do because if you switch\
-to another branch you will loose your changes and it can be difficult\
+to another branch you will lose your changes and it can be difficult\
 to retrieve them later from the reflog. You should probably cancel this\
 commit and create a new branch to continue.\n\
 \n\
-- 
1.7.10.4

```

## Beat Bolli, 2012-08-18 09:07

Subject: [PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing
Message-ID: <1345280851-6626-2-git-send-email-bbolli@ewanet.ch>
URL: https://gitlist.dev/e/1345280851-6626-2-git-send-email-bbolli%40ewanet.ch
In-Reply-To: <1345280851-6626-1-git-send-email-bbolli@ewanet.ch>

```
Adding __git_ps1() to one's bash prompt displays various repo status
info after each command. After committing a git cherry-pick -n using
git-gui, the prompt still contains the "|CHERRY-PICKING" flag.

Delete the file causing this flag when cleaning up.

Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
---
 git-gui/lib/commit.tcl |    1 +
 1 file changed, 1 insertion(+)

diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
index 78c5eeb..864b687 100644
--- a/git-gui/lib/commit.tcl
+++ b/git-gui/lib/commit.tcl
@@ -409,6 +409,7 @@ A rescan will be automatically started now.
 	catch {file delete [gitdir MERGE_MSG]}
 	catch {file delete [gitdir SQUASH_MSG]}
 	catch {file delete [gitdir GITGUI_MSG]}
+	catch {file delete [gitdir CHERRY_PICK_HEAD]}
 
 	# -- Let rerere do its thing.
 	#
-- 
1.7.10.4

```

## Junio C Hamano, 2012-08-18 20:24

Subject: Re: [PATCH 1/2] git-gui: Fix a loose/lose mistake
Message-ID: <7vsjbkrlsv.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vsjbkrlsv.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1345280851-6626-1-git-send-email-bbolli@ewanet.ch>

```
Beat Bolli <bbolli@ewanet.ch> writes:

> No po update needed, as this string is untranslated.
>
> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
> ---
>  git-gui/lib/commit.tcl |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
> index 0d81432..78c5eeb 100644
> --- a/git-gui/lib/commit.tcl
> +++ b/git-gui/lib/commit.tcl
> @@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} {
>  	    && 	[is_config_true gui.warndetachedcommit]} {
>  		set msg [mc "You are about to commit on a detached head.\
>  This is a potentially dangerous thing to do because if you switch\
> -to another branch you will loose your changes and it can be difficult\
> +to another branch you will lose your changes and it can be difficult\
>  to retrieve them later from the reflog. You should probably cancel this\
>  commit and create a new branch to continue.\n\
>  \n\

Looks obviously correct; Pat?

```

## Junio C Hamano, 2012-08-18 20:28

Subject: Re: [PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing
Message-ID: <7vobm8rllv.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vobm8rllv.fsf%40alter.siamese.dyndns.org
In-Reply-To: <1345280851-6626-2-git-send-email-bbolli@ewanet.ch>

```
Beat Bolli <bbolli@ewanet.ch> writes:

> Adding __git_ps1() to one's bash prompt displays various repo status
> info after each command. After committing a git cherry-pick -n using
> git-gui, the prompt still contains the "|CHERRY-PICKING" flag.
>
> Delete the file causing this flag when cleaning up.
>
> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
> ---
>  git-gui/lib/commit.tcl |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
> index 78c5eeb..864b687 100644
> --- a/git-gui/lib/commit.tcl
> +++ b/git-gui/lib/commit.tcl
> @@ -409,6 +409,7 @@ A rescan will be automatically started now.
>  	catch {file delete [gitdir MERGE_MSG]}
>  	catch {file delete [gitdir SQUASH_MSG]}
>  	catch {file delete [gitdir GITGUI_MSG]}
> +	catch {file delete [gitdir CHERRY_PICK_HEAD]}
>  
>  	# -- Let rerere do its thing.
>  	#

It makes me wonder if the above sequence of file delete should all
be removed and use "git commit" instead of "git commit-tree" in the
implementation of this Tcl procedure instead.

Pat?

```

## Pat Thoyts, 2012-09-17 10:54

Subject: Re: [PATCH 1/2] git-gui: Fix a loose/lose mistake
Message-ID: <87d31kkjgw.fsf@fox.patthoyts.tk>
URL: https://gitlist.dev/e/87d31kkjgw.fsf%40fox.patthoyts.tk
In-Reply-To: <7vsjbkrlsv.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

>Beat Bolli <bbolli@ewanet.ch> writes:
>
>> No po update needed, as this string is untranslated.
>>
>> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
>> ---
>>  git-gui/lib/commit.tcl |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
>> index 0d81432..78c5eeb 100644
>> --- a/git-gui/lib/commit.tcl
>> +++ b/git-gui/lib/commit.tcl
>> @@ -268,7 +268,7 @@ proc commit_commitmsg {curHEAD msg_p} {
>>  	    && 	[is_config_true gui.warndetachedcommit]} {
>>  		set msg [mc "You are about to commit on a detached head.\
>>  This is a potentially dangerous thing to do because if you switch\
>> -to another branch you will loose your changes and it can be difficult\
>> +to another branch you will lose your changes and it can be difficult\
>>  to retrieve them later from the reflog. You should probably cancel this\
>>  commit and create a new branch to continue.\n\
>>  \n\
>
>Looks obviously correct; Pat?
>

Yes. Applied.

-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

```

## Pat Thoyts, 2012-09-17 11:52

Subject: Re: [PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing
Message-ID: <878vc8kgsf.fsf@fox.patthoyts.tk>
URL: https://gitlist.dev/e/878vc8kgsf.fsf%40fox.patthoyts.tk
In-Reply-To: <7vobm8rllv.fsf@alter.siamese.dyndns.org>

```
Junio C Hamano <gitster@pobox.com> writes:

>Beat Bolli <bbolli@ewanet.ch> writes:
>
>> Adding __git_ps1() to one's bash prompt displays various repo status
>> info after each command. After committing a git cherry-pick -n using
>> git-gui, the prompt still contains the "|CHERRY-PICKING" flag.
>>
>> Delete the file causing this flag when cleaning up.
>>
>> Signed-off-by: Beat Bolli <bbolli@ewanet.ch>
>> ---
>>  git-gui/lib/commit.tcl |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/git-gui/lib/commit.tcl b/git-gui/lib/commit.tcl
>> index 78c5eeb..864b687 100644
>> --- a/git-gui/lib/commit.tcl
>> +++ b/git-gui/lib/commit.tcl
>> @@ -409,6 +409,7 @@ A rescan will be automatically started now.
>>  	catch {file delete [gitdir MERGE_MSG]}
>>  	catch {file delete [gitdir SQUASH_MSG]}
>>  	catch {file delete [gitdir GITGUI_MSG]}
>> +	catch {file delete [gitdir CHERRY_PICK_HEAD]}
>>  
>>  	# -- Let rerere do its thing.
>>  	#
>
>It makes me wonder if the above sequence of file delete should all
>be removed and use "git commit" instead of "git commit-tree" in the
>implementation of this Tcl procedure instead.
>
>Pat?
>

I agree - this looks like the code in contrib/examples/git-commit.sh so
presumably predates the builtin 'commit' command.
For now I've applied the above - but this should be changed to just call
commit normally from what I can see. Thats added to my todo.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD

```
