# [PATCH] Document "git stash message..."

5 messages from 2007-07-17 to 2007-08-01. Participants: しらいしななこ, Junio C Hamano, Johannes Schindelin, Shawn O. Pearce.
Thread: https://gitlist.dev/t/9068

## しらいしななこ, 2007-07-17 08:15

Subject: [PATCH] Document "git stash message..."
Message-ID: <20070624192215.6117@nanako3.bluebottle.com>
URL: https://gitlist.dev/e/20070624192215.6117%40nanako3.bluebottle.com

```
The command was recently updated to take message on the command line, but
this feature has not been documented.

Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>
---
 Documentation/git-stash.txt |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
index ad95ed9..4404361 100644
--- a/Documentation/git-stash.txt
+++ b/Documentation/git-stash.txt
@@ -8,7 +8,8 @@ git-stash - Stash the changes in a dirty working directory away
 SYNOPSIS
 --------
 [verse]
-'git-stash' (save | list | show [<stash>] | apply [<stash>] | clear)
+'git-stash' (list | show [<stash>] | apply [<stash>] | clear)
+'git-stash' [save] [message...]
 
 DESCRIPTION
 -----------
@@ -22,7 +23,9 @@ The modifications stashed away by this command can be listed with
 `git-stash list`, inspected with `git-stash show`, and restored
 (potentially on top of a different commit) with `git-stash apply`.
 Calling git-stash without any arguments is equivalent to `git-stash
-save`.
+save`.  A stash is by default listed as "WIP on 'branchname' ...", but
+you can give more descriptive message on the command line when
+you create one.
 
 The latest stash you created is stored in `$GIT_DIR/refs/stash`; older
 stashes are found in the reflog of this reference and can be named using
@@ -48,8 +51,8 @@ list::
 	based on.
 +
 ----------------------------------------------------------------
-stash@{0}: submit: 6ebd0e2... Add git-stash
-stash@{1}: master: 9cc0589... Merge branch 'master' of gfi
+stash@{0}: WIP on submit: 6ebd0e2... Update git-stash documentation
+stash@{1}: On master: 9cc0589... Add git-stash
 ----------------------------------------------------------------
 
 show [<stash>]::

-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/

----------------------------------------------------------------------
Get a free email account with anti spam protection.
http://www.bluebottle.com/tag/2

```

## Junio C Hamano, 2007-07-17 08:50

Subject: Re: [PATCH] Document "git stash message..."
Message-ID: <7vps2r9zx2.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vps2r9zx2.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070624192215.6117@nanako3.bluebottle.com>

```
しらいしななこ  <nanako3@bluebottle.com> writes:

> The command was recently updated to take message on the command line, but
> this feature has not been documented.
>
> Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com>

Thanks -- that was my fault.

>  Documentation/git-stash.txt |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/git-stash.txt b/Documentation/git-stash.txt
> index ad95ed9..4404361 100644
> --- a/Documentation/git-stash.txt
> +++ b/Documentation/git-stash.txt
> @@ -22,7 +23,9 @@ The modifications stashed away by this command can be listed with
>  `git-stash list`, inspected with `git-stash show`, and restored
>  (potentially on top of a different commit) with `git-stash apply`.
>  Calling git-stash without any arguments is equivalent to `git-stash
> -save`.
> +save`.  A stash is by default listed as "WIP on 'branchname' ...", but
> +you can give more descriptive message on the command line when
> +you create one.

Perhaps "give a more descriptive message"?

```

## Junio C Hamano, 2007-07-22 09:45

Subject: Re: [PATCH] Update Japanese messages
Message-ID: <7vzm1orcty.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzm1orcty.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070624192215.6117@nanako3.bluebottle.com>

```
Thanks.  Me being a Japanese, it would have been very
embarrasing to keep a very incomplete Japanese message file in
the project ;-).

The translation looks good.  Johannes, if you haven't got around
it yet, please apply.

```

## Johannes Schindelin, 2007-07-22 11:41

Subject: Re: [PATCH] Update Japanese messages
Message-ID: <Pine.LNX.4.64.0707221240090.14781@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0707221240090.14781%40racer.site
In-Reply-To: <7vzm1orcty.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Sun, 22 Jul 2007, Junio C Hamano wrote:

> Thanks.  Me being a Japanese, it would have been very
> embarrasing to keep a very incomplete Japanese message file in
> the project ;-).
> 
> The translation looks good.  Johannes, if you haven't got around
> it yet, please apply.

So done (actually I just merged the mob branch ;-).  Thanks, both of you.

Ciao,
Dscho

```

## Shawn O. Pearce, 2007-08-01 13:38

Subject: Re: git-gui: diff/console part does not show UTF-8 Japanese
Message-ID: <20070801133842.GG20052@spearce.org>
URL: https://gitlist.dev/e/20070801133842.GG20052%40spearce.org
In-Reply-To: <7vvebz602q.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano <gitster@pobox.com> wrote:
> Nanako Shiraishi <nanako3@bluebottle.com> writes:
> 
> > 	I was testing git-gui (i18n branch).  I can see the translated 
> > message in the UI buttons and menus, and also commit message part shows 
> > Japanese strings, but I cannot get the diff part at the bottom to show 
> > Japanese.  Because I did set the two fonts to the same font from the 
> > Edit/Option menu, I do not think it is the problem with the font 
> > settings.
> >
> > Can anybody help?
> 
> I can see the same breakage in regular git-gui without i18n.
> Curious.  The commit message shows Japanese but diff part is
> bogus.
> 
> And the breakage is not just Japanese.  I can see this with
> Kristian's name by resetting a branch to 12ace0b2 and then
> attempting to amend it.  Interestingly enough, gitk shows the
> patch as expected.  I do not quite know how it is arranged
> there, though.
> 
> Now, I freely admit I do not quite know what I am doing, but
> this patch that tries to mimick the handling of commit log
> message seems to help it for git-gui.
> 
> I do think using i18n.commitencoding for payload is wrong,
> though.

Yea, it is wrong.  The patch is logically fine as-is, there's nothing
wrong with it except this part.  I think the reason that gitk shows
the patch as expected is because it is using i18n.commitencoding
for the payload, and that's only happening as a side-effect of how
it used it for the commit message itself.  Call it dumb luck the
thing even displays right.

To really Do The Right Thing(tm) here I think we need to store an
encoding for each file path so we know what we are looking at when
we see the file content.  E.g. a gitattributes enc attribute?

For some files we might be able to guess.  But I have to admit,
I'm not up on my encoding guessing algorithms.  ;-)

For XML files we can probably guess its XML ("starts with <?xml")
and we can guess the encoding from that header line.  But not
everything that contains Japanese characters is an XML file.
Like .po files for instance.


Where it gets even more interesting is how do I show a patch
where the encoding changed?  E.g. reencode a file from ISO-8859-1
into UTF-8?  A number of lines would probably be identical, except
for their encoding.  So the user would want to see that they are
the same.  So we really should be able to show the old line using
its old encoding, and the new line using its new encoding.  Hmmph.

As a stop-gap I guess I could include a "Change Encoding" option
for the diff pane and let you set the encoding to a specific name.
But I really think git-gui should be able to do better than that.

-- 
Shawn.

```
