<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-stash.sh, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-06-13T15:27:13Z</updated>
<entry>
<title>git-stash: fix pushing stash with pathspec from subdir</title>
<updated>2017-06-13T15:27:13Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2017-06-13T11:38:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=22fc703ec949602e9fd4e2ab0bb63dd47c2945b5'/>
<id>urn:sha1:22fc703ec949602e9fd4e2ab0bb63dd47c2945b5</id>
<content type='text'>
The `git stash push` command recently gained the ability to get a
pathspec as its argument to only stash matching files. Calling this
command from a subdirectory does not work, though, as one of the first
things we do is changing to the top level directory without keeping
track of the prefix from which the command is being run.

Fix the shortcoming by storing the prefix previous to the call to
`cd_to_toplevel` and then subsequently using `git rev-parse --prefix` to
correctly resolve the pathspec. Add a test to catch future breakage of
this usecase.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: keep untracked files intact in stash -k</title>
<updated>2017-03-22T21:55:56Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-03-21T22:12:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e0e7f99ea400808cd11af72425c721c8b44193ca'/>
<id>urn:sha1:e0e7f99ea400808cd11af72425c721c8b44193ca</id>
<content type='text'>
Currently when there are untracked changes in a file "one" and in a file
"two" in the repository and the user uses:

    git stash push -k one

all changes in "two" are wiped out completely.  That is clearly not the
intended result.  Make sure that only the files given in the pathspec
are changed when git stash push -k &lt;pathspec&gt; is used.

Reported-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: pass the pathspec argument to git reset</title>
<updated>2017-03-22T21:55:55Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-03-21T22:12:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=869fb8f729a4e3486ea3c37820e97548223fac6a'/>
<id>urn:sha1:869fb8f729a4e3486ea3c37820e97548223fac6a</id>
<content type='text'>
For "git stash -p --no-keep-index", the pathspec argument is currently
not passed to "git reset".  This means that changes that are staged but
that are excluded from the pathspec still get unstaged by git stash -p.

Make sure that doesn't happen by passing the pathspec argument to the
git reset in question, bringing the behaviour in line with "git stash --
&lt;pathspec&gt;".

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: don't show internal implementation details</title>
<updated>2017-03-22T21:55:11Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-03-21T22:12:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1790f4fea04c2401feda0c96e35a3b50b1ba4fe3'/>
<id>urn:sha1:1790f4fea04c2401feda0c96e35a3b50b1ba4fe3</id>
<content type='text'>
git stash push uses other git commands internally.  Currently it only
passes the -q flag to those if the -q flag is passed to git stash.  when
using 'git stash push -p -q --no-keep-index', it doesn't even pass the
flag on to the internal reset at all.

It really is enough for the user to know that the stash is created,
without bothering them with the internal details of what's happening.
Always pass the -q flag to the internal git clean and git reset
commands, to avoid unnecessary and potentially confusing output.

Reported-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: allow pathspecs in the no verb form</title>
<updated>2017-02-28T22:21:10Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-02-28T20:33:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9e140909f611fff720efc914b7186b8e4ab722cd'/>
<id>urn:sha1:9e140909f611fff720efc914b7186b8e4ab722cd</id>
<content type='text'>
Now that stash_push is used in the no verb form of stash, allow
specifying the command line for this form as well.  Always use -- to
disambiguate pathspecs from other non-option arguments.

Also make git stash -p an alias for git stash push -p.  This allows
users to use git stash -p &lt;pathspec&gt;.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: use stash_push for no verb form</title>
<updated>2017-02-28T22:21:10Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-02-28T20:33:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1ada5020b38c520f665259f6d9b3955672b92761'/>
<id>urn:sha1:1ada5020b38c520f665259f6d9b3955672b92761</id>
<content type='text'>
Now that we have stash_push, which accepts pathspec arguments, use
it instead of stash_save in git stash without any additional verbs.

Previously we allowed git stash -- -message, which is no longer allowed
after this patch.  Messages starting with a hyphen was allowed since
3c2eb80f, ("stash: simplify defaulting to "save" and reject unknown
options").  However it was never the intent to allow that, but rather it
was allowed accidentally.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: teach 'push' (and 'create_stash') to honor pathspec</title>
<updated>2017-02-28T22:21:05Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-02-28T20:33:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df6bba0937209d679a06addd26975593fef744f2'/>
<id>urn:sha1:df6bba0937209d679a06addd26975593fef744f2</id>
<content type='text'>
While working on a repository, it's often helpful to stash the changes
of a single or multiple files, and leave others alone.  Unfortunately
git currently offers no such option.  git stash -p can be used to work
around this, but it's often impractical when there are a lot of changes
over multiple files.

Allow 'git stash push' to take pathspec to specify which paths to stash.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: refactor stash_create</title>
<updated>2017-02-20T07:47:41Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-02-19T11:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ca6326dff29b97cfb126e6460105920c492fa15'/>
<id>urn:sha1:9ca6326dff29b97cfb126e6460105920c492fa15</id>
<content type='text'>
Refactor the internal stash_create function to use a -m flag for
specifying the message and -u flag to indicate whether untracked files
should be added to the stash.

This makes it easier to pass a pathspec argument to stash_create in the
next patch.

The user interface for git stash create stays the same.

Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>stash: introduce push verb</title>
<updated>2017-02-20T07:47:41Z</updated>
<author>
<name>Thomas Gummerer</name>
<email>t.gummerer@gmail.com</email>
</author>
<published>2017-02-19T11:03:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f5727e26e44dbbf564034d3993d4d2f65dacd6fb'/>
<id>urn:sha1:f5727e26e44dbbf564034d3993d4d2f65dacd6fb</id>
<content type='text'>
Introduce a new git stash push verb in addition to git stash save.  The
push verb is used to transition from the current command line arguments
to a more conventional way, in which the message is given as an argument
to the -m option.

This allows us to have pathspecs at the end of the command line
arguments like other Git commands do, so that the user can say which
subset of paths to stash (and leave others behind).

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Thomas Gummerer &lt;t.gummerer@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/stash-disable-renames-internally' into maint</title>
<updated>2017-01-17T22:49:30Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-17T22:49:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=12361d025fe0752342dabb06d79ff541eb081002'/>
<id>urn:sha1:12361d025fe0752342dabb06d79ff541eb081002</id>
<content type='text'>
When diff.renames configuration is on (and with Git 2.9 and later,
it is enabled by default, which made it worse), "git stash"
misbehaved if a file is removed and another file with a very
similar content is added.

* jk/stash-disable-renames-internally:
  stash: prefer plumbing over git-diff
</content>
</entry>
</feed>
