threads / patch / 31277

patch, 2 partsgit-gui: Fix a loose/lose mistake

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

## tl;dr

6 messages between Aug 18, 2012 and Sep 17, 2012. Diffs are folded; open one to read it.

replies: 5people: 3as markdown or json

Beat Bolli· Aug 18, 2012, 09:07 UTC · lore
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(-)
Show changes to git-gui/lib/commit.tcl +1 −1
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· Aug 18, 2012, 09:07 UTC · re: Beat Bolli · lore

[PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing

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(+)
Show changes to git-gui/lib/commit.tcl +1 −0
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· Aug 18, 2012, 20:28 UTC · re: Beat Bolli · lore

Re: [PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing

Beat Bolli <bbolli@ewanet.ch> writes:
Show 23 quoted lines
> 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· Sep 17, 2012, 11:52 UTC · re: Junio C Hamano · lore

Re: [PATCH 2/2] git-gui: remove .git/CHERRY_PICK_HEAD after committing

Junio C Hamano <gitster@pobox.com> writes:
Show 32 quoted lines
>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
Junio C Hamano· Aug 18, 2012, 20:24 UTC · re: Beat Bolli · lore

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

Beat Bolli <bbolli@ewanet.ch> writes:
Show 20 quoted lines
> 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?
Pat Thoyts· Sep 17, 2012, 10:54 UTC · re: Junio C Hamano · lore

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

Junio C Hamano <gitster@pobox.com> writes:
Show 25 quoted lines
>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

← back to recent threads