threads / patch / 8032

patchgit-gui: Call changes "Staged" and "Unstaged" in file list titles.

Subject: [PATCH] git-gui: Call changes "Staged" and "Unstaged" in file list titles.

## tl;dr

4 messages between May 8, 2007 and May 8, 2007. Diffs are folded; open one to read it.

replies: 3people: 4as markdown or json

Johannes Sixt· May 8, 2007, 11:33 UTC · lore
From: Johannes Sixt <johannes.sixt@telecom.at>

All menu entries talk about "staging" and "unstaging" changes, but the titles of the file lists use different wording, which may confuse newcomers.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
I hope the patch went through without my MUA's "improvements".
Hannes
 git-gui/git-gui.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to git-gui/git-gui.sh +2 −2
diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 60e79ca..45d251e 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -5494,7 +5494,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
 # -- Index File List
 #
 frame .vpane.files.index -height 100 -width 200
-label .vpane.files.index.title -text {Changes To Be Committed} \
+label .vpane.files.index.title -text {Staged Changes (Will Be Committed)} \
 	-background green \
 	-font font_ui
 text $ui_index -background white -borderwidth 0 \
@@ -5516,7 +5516,7 @@ pack $ui_index -side left -fill both -expand 1
 # -- Working Directory File List
 #
 frame .vpane.files.workdir -height 100 -width 200
-label .vpane.files.workdir.title -text {Changed But Not Updated} \
+label .vpane.files.workdir.title -text {Unstaged Changes (Will Not Be Committed)} \
 	-background red \
 	-font font_ui
 text $ui_workdir -background white -borderwidth 0 \
-- 
1.5.1.1.27.g91776
Shawn O. Pearce· May 8, 2007, 14:38 UTC · re: Johannes Sixt · lore

Re: [PATCH] git-gui: Call changes "Staged" and "Unstaged" in file list titles.

Johannes Sixt <J.Sixt@eudaptics.com> wrote:
Show 9 quoted lines
> From: Johannes Sixt <johannes.sixt@telecom.at>
> 
> All menu entries talk about "staging" and "unstaging" changes, but the
> titles of the file lists use different wording, which may confuse
> newcomers.
> 
> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
> ---
> I hope the patch went through without my MUA's "improvements".
Yes.  But...
 
>  git-gui/git-gui.sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

That's the wrong path. Clearly you made this patch in git.git and not the git-gui.git repository itself. Fortunately for me I added -3 to git-am out of habit:

  $ git am -3 -s gg
  Applying 'git-gui: Call changes "Staged" and "Unstaged" in file list titles.'
  
  error: git-gui/git-gui.sh: does not exist in index
  Using index info to reconstruct a base tree...
  Falling back to patching base and 3-way merge...
  Renamed git-gui/git-gui.sh => git-gui.sh
  Wrote tree 8e034a94d9533af707279766e174b78ddf3874cc
  Committed: a1a4975824e8f9f88a8c96ae908c488a2c6047c5
Yay Git!  Go go gadget rename detection!  ;-)

I didn't even realize the git-gui/ prefix on the path in the patch until after I saw the rename detection message.

-- 
Shawn.
Junio C Hamano· May 8, 2007, 19:29 UTC · re: Shawn O. Pearce · lore

Re: [PATCH] git-gui: Call changes "Staged" and "Unstaged" in file list titles.

"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 23 quoted lines
> Yes.  But...
>  
>>  git-gui/git-gui.sh |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> That's the wrong path.  Clearly you made this patch in git.git and
> not the git-gui.git repository itself.  Fortunately for me I added
> -3 to git-am out of habit:
>
>   $ git am -3 -s gg
>   Applying 'git-gui: Call changes "Staged" and "Unstaged" in file list titles.'
>   
>   error: git-gui/git-gui.sh: does not exist in index
>   Using index info to reconstruct a base tree...
>   Falling back to patching base and 3-way merge...
>   Renamed git-gui/git-gui.sh => git-gui.sh
>   Wrote tree 8e034a94d9533af707279766e174b78ddf3874cc
>   Committed: a1a4975824e8f9f88a8c96ae908c488a2c6047c5
>
> Yay Git!  Go go gadget rename detection!  ;-)
>
> I didn't even realize the git-gui/ prefix on the path in the patch
> until after I saw the rename detection message.
Yeah, -3 is a magic, isn't it?

For the benefit of people who are unfamiliar with the internal, here is how it works.

 - The patch Hannes gave Shawn had a change to
   git-gui/git-gui.sh, like this:
    git-gui/git-gui.sh |    4 ++--
    1 files changed, 2 insertions(+), 2 deletions(-)
   diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
   index 60e79ca..45d251e 100755
    --- a/git-gui/git-gui.sh
    +++ b/git-gui/git-gui.sh
    @@ -5494,7 +5494,7 @@ pack .vpane -anchor n -side top -fill both -expand 1
 - Shawn had a tree that looked like this:
        GIT-VERSION-GEN
        Makefile
        git-gui.sh
        lib/blame.tcl
        lib/branch.tcl
        ...
 - The patch obviously does not apply, as Shawn does not have
   git-gui/git-gui.sh.  However, Shawn instructed "git am" to
   fall back on 3-way merge, which prepared two "fake" trees.
   Fake tree 1 (the ancestor) is prepared by reading the index
   line to figure out what blob the patch applies to.  The
   answer is 60e79ca, which Shawn has in his repository.  The
   resulting tree looks like this:
        040000 tree 0df2c7b...  git-gui
        100755 blob 60e79ca...  git-gui/git-gui.sh
   Fake tree 2 (update) is prepared by applying the patch to the
   ancestor fake tree.
        040000 tree 950e50d...	git-gui
        100755 blob 45d251e...	git-gui/git-gui.sh
 - Then, it falls back to the 3-way merge, using the fake tree 1
   as the common ancestor, Shawn's repository as "our" tree, and
   fake tree 2 as the update being merged into "our" tree.
   To this merge, most of the paths in "our" tree appear as if
   Shawn added them since the common ancestor, except that
   git-gui.sh at the toplevel in "our" tree was moved up by
   Shawn from git-gui subdirectory (and then possibly further
   modified), while git-gui/git-gui.sh was modified by Hannes.
   At the path level, this is the classic case of "one side
   (Shawn) modifies, while the other side (Hannes) kept it at
   the place it was before", 3-way merge at the path level takes
   Shawn's change (which is to "move the file up one level").
   At the same time, at the contents level, this is just a
   normal "common ancestor 60e79ca was modified to Shawn's
   git-gui.sh on one side while Hannes's side modified it to
   45d251e", and the contents are merged using the file level
   3-way merge.  The result is left in git-gui.sh.
   All the other paths look as if Shawn added them to the common
   ancestor that did not have any of them while Hannes did not
   do any such change, so the merge algorithm takes Shawn's
   "additions".

So in the end, Shawn ends up with most of his paths intact, except that Hannes's patch which were meant to apply to git-gui/git-gui.sh gets applied to his git-gui.sh.

← back to recent threads