<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-stash.sh, branch v2.10.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.10.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.10.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-08-10T17:50:18Z</updated>
<entry>
<title>i18n: git-stash: mark messages for translation</title>
<updated>2016-08-10T17:50:18Z</updated>
<author>
<name>Vasco Almeida</name>
<email>vascomalmeida@sapo.pt</email>
</author>
<published>2016-08-10T10:50:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=599e7a0b9e86dab9e6b2c7a136fe04b6b52a923a'/>
<id>urn:sha1:599e7a0b9e86dab9e6b2c7a136fe04b6b52a923a</id>
<content type='text'>
Signed-off-by: Vasco Almeida &lt;vascomalmeida@sapo.pt&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>i18n: git-sh-setup.sh: mark strings for translation</title>
<updated>2016-06-17T22:45:48Z</updated>
<author>
<name>Vasco Almeida</name>
<email>vascomalmeida@sapo.pt</email>
</author>
<published>2016-06-17T20:21:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d323c6b6410dee0a8a2471b4dbf6d631cd3c3d4d'/>
<id>urn:sha1:d323c6b6410dee0a8a2471b4dbf6d631cd3c3d4d</id>
<content type='text'>
Positional arguments, such as $0, $1, etc, need to be stored on shell
variables for use in translatable strings, according to gettext manual
[1].

Add git-sh-setup.sh to LOCALIZED_SH variable in Makefile to enable
extraction of string marked for translation by xgettext.

Source git-sh-i18n in git-sh-setup.sh for gettext support.
git-sh-setup.sh is a shell library to be sourced by other shell scripts.
In order to avoid other scripts from sourcing git-sh-i18n twice, remove
line that sources it from them.  Not sourcing git-sh-i18n in any script
that uses gettext would lead to failure due to, for instance, gettextln
not being found.

[1] http://www.gnu.org/software/gettext/manual/html_node/Preparing-Shell-Scripts.html

Signed-off-by: Vasco Almeida &lt;vascomalmeida@sapo.pt&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>always quote shell arguments to test -z/-n</title>
<updated>2016-05-14T17:37:29Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-05-13T20:47:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=268ef4d3d07e4cf9909ac060b63b195509391190'/>
<id>urn:sha1:268ef4d3d07e4cf9909ac060b63b195509391190</id>
<content type='text'>
In shell code like:

  test -z $foo
  test -n $foo

that does not quote its arguments, it's easy to think that
it is actually looking at the contents of $foo in each case.
But if $foo is empty, then "test" does not see any argument
at all! The results are quite subtle.

POSIX specifies that test's behavior depends on the number
of arguments it sees, and if $foo is empty, it sees only
one. The behavior in this case is:

  1 argument: Exit true (0) if $1 is not null; otherwise,
              exit false.

So in the "-z $foo" case, if $foo is empty, then we check
that "-z" is non-null, and it returns success. Which happens
to match what we expected.  But for "-n $foo", if $foo is
empty, we'll see that "-n" is non-null and still return
success. That's the opposite of what we intended!

Furthermore, if $foo contains whitespace, we'll end up with
more than 2 arguments. The results in this case are
generally unspecified (unless the first part of $foo happens
to be a valid binary operator, in which case the results are
specified but certainly not what we intended).

And on top of this, even though "test -z $foo" _should_ work
for the empty case, some older shells (reportedly ksh88)
complain about the missing argument.

So let's make sure we consistently quote our variable
arguments to "test". After this patch, the results of:

  git grep 'test -[zn] [^"]'

are empty.

Reported-by: Armin Kunaschik &lt;megabreit@googlemail.com&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'nk/stash-show-config'</title>
<updated>2015-10-05T19:30:10Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-10-05T19:30:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e9a74b48013a99daff50c2995ad9de80685335f'/>
<id>urn:sha1:5e9a74b48013a99daff50c2995ad9de80685335f</id>
<content type='text'>
Users who are too busy to type three extra keystrokes to ask for
"git stash show -p" can now set stash.showPatch configuration
varible to true to always see the actual patch, not just the list
of paths affected with feel for the extent of damage via diffstat.

* nk/stash-show-config:
  stash: allow "stash show" diff output configurable
</content>
</entry>
<entry>
<title>stash: allow "stash show" diff output configurable</title>
<updated>2015-08-31T18:29:04Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@gmail.com</email>
</author>
<published>2015-08-29T15:25:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3086c064fbbf3c4d086f9d7c303d9aa76f5204b2'/>
<id>urn:sha1:3086c064fbbf3c4d086f9d7c303d9aa76f5204b2</id>
<content type='text'>
Some users might want to see diff (patch) output always rather than
diffstat when [s]he runs 'git stash show'.  Although this can be
done with adding -p option, users are too lazy to type extra three
keys.

Add two variables that control to show diffstat and patch output
respectively.  The stash.showStat is for diffstat and default is
true.  The stat.showPatch is for the patch output and default is
false.

Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-stash: use update-ref --create-reflog instead of creating files</title>
<updated>2015-07-21T21:08:49Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2015-07-21T21:04:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=89dea973349769efa8facc6f7b11095958205d4d'/>
<id>urn:sha1:89dea973349769efa8facc6f7b11095958205d4d</id>
<content type='text'>
This is in support of alternate ref backends which don't necessarily
store reflogs as files.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/stash-require-clean-index'</title>
<updated>2015-06-24T19:21:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-24T19:21:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bfb539bb734ee4bc63bf2a6010f935caa78b2b79'/>
<id>urn:sha1:bfb539bb734ee4bc63bf2a6010f935caa78b2b79</id>
<content type='text'>
A hotfix for the topic already in 'master'.

* jk/stash-require-clean-index:
  Revert "stash: require a clean index to apply"
</content>
</entry>
<entry>
<title>Revert "stash: require a clean index to apply"</title>
<updated>2015-06-15T20:11:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-06-15T18:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=19376104a8251a7e6c56579cdcd2eb0a106d1fd6'/>
<id>urn:sha1:19376104a8251a7e6c56579cdcd2eb0a106d1fd6</id>
<content type='text'>
This reverts commit ed178ef13a26136d86ff4e33bb7b1afb5033f908.

That commit was an attempt to improve the safety of applying
a stash, because the application process may create
conflicted index entries, after which it is hard to restore
the original index state.

Unfortunately, this hurts some common workflows around "git
stash -k", like:

    git add -p       ;# (1) stage set of proposed changes
    git stash -k     ;# (2) get rid of everything else
    make test        ;# (3) make sure proposal is reasonable
    git stash apply  ;# (4) restore original working tree

If you "git commit" between steps (3) and (4), then this
just works. However, if these steps are part of a pre-commit
hook, you don't have that opportunity (you have to restore
the original state regardless of whether the tests passed or
failed).

It's possible that we could provide better tools for this
sort of workflow. In particular, even before ed178ef, it
could fail with a conflict if there were conflicting hunks
in the working tree and index (since the "stash -k" puts the
index version into the working tree, and we then attempt to
apply the differences between HEAD and the old working tree
on top of that). But the fact remains that people have been
using it happily for a while, and the safety provided by
ed178ef is simply not that great. Let's revert it for now.
In the long run, people can work on improving stash for this
sort of workflow, but the safety tradeoff is not worth it in
the meantime.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/stash-options'</title>
<updated>2015-06-01T19:45:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-06-01T19:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f693bb0bb0d18d6150d6059dfad5018501a9713a'/>
<id>urn:sha1:f693bb0bb0d18d6150d6059dfad5018501a9713a</id>
<content type='text'>
Make "git stash something --help" error out, so that users can
safely say "git stash drop --help".

* jk/stash-options:
  stash: recognize "--help" for subcommands
  stash: complain about unknown flags
</content>
</entry>
<entry>
<title>stash: recognize "--help" for subcommands</title>
<updated>2015-05-20T20:47:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-05-20T18:17:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ba28313f29bcc2e8571c4b325646fecfbe238df'/>
<id>urn:sha1:5ba28313f29bcc2e8571c4b325646fecfbe238df</id>
<content type='text'>
If you run "git stash --help", you get the help for stash
(this magic is done by the git wrapper itself). But if you
run "git stash drop --help", you get an error. We
cannot show help specific to "stash drop", of course, but we
can at least give the user the normal stash manpage.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
