Re: [PATCH] Revert "stash: require a clean index to apply"

2015-06-25 Thread Jonathan Kamens

Um.

I encountered this issue in git 2.4.3 on Fedora 22.

These lines appear in /usr/libexec/git-core/git-stash on my Fedora 22 
system:


git diff-index --cached --quiet --ignore-submodules HEAD -- ||
die "$(gettext "Cannot apply stash: Your index contains 
uncommitted changes.")"


They also appear in 
https://github.com/git/git/blob/69f9a6e54a46c4a75dff680047a465d04cca20ca/git-stash.sh#L445 
, which is the commit tagged v2.4.3.


In fact, it appears they were released in v2.4.2, at least according to 
https://github.com/git/git/compare/v2.4.1...v2.4.2 .


So it appears to me that this patch was, in fact, released in v2.4.x and 
therefore needs to be reverted in v2.4.x.


  jik

On 06/25/2015 08:27 PM, Jeff King wrote:

On Thu, Jun 25, 2015 at 05:49:11PM -0400, Jonathan Kamens wrote:


Is this revert going to be applied and released?

It is on "master", and part of v2.5.0-rc0 (it is not part of v2.4.x, because
the original problem was not there, either).

-Peff


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Revert "stash: require a clean index to apply"

2015-06-25 Thread Jonathan Kamens
Is this revert going to be applied and released?

Sent from my Android device



-Original Message-
From: Junio C Hamano 
To: Jeff King 
Cc: "bär" , Jonathan Kamens , 
Git List 
Sent: Mon, 15 Jun 2015 4:11 PM
Subject: Re: [PATCH] Revert "stash: require a clean index to apply"

Jeff King  writes:

> Subject: Revert "stash: require a clean index to apply"
>
> This reverts commit ed178ef13a26136d86ff4e33bb7b1afb5033f908.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] stash: require a clean index to apply

2015-06-04 Thread Jonathan Kamens
I'm writing about the patch that Jeff King submitted on April 22, in 
<20150422193101.gc27...@peff.net>, in particular, 
https://github.com/git/git/commit/ed178ef13a26136d86ff4e33bb7b1afb5033f908 
. It appears that this patch was included in git 2.4.2, and it breaks my 
workflow.


In particular, I have a pre-commit hook whith does the following:

1. Stash unstaged changes ("git stash -k").
2. Run flake8 over all staged changes.
3. If flake8 complains, then error out of the commit.
4. Otherwise, apply the stash and exit.

This way I am prevented from committing staged changes that don't pass 
flake8. I can't imagine that this is a terribly uncommon workflow.


This worked fine until the aforementioned comment, after which my hook 
complains, "Cannot apply stash: Your index contains uncommitted changes."


The reason I have to do things this way is as follows. Suppose I did the 
following:


1. Stage changes that have a flake8 violation.
2. Fix the flake8 violation in the unstaged version of the staged file.
3. Commit the previously staged changes.

If my commit hook runs over the unstaged version of the file, then it 
won't detect the flake8 violation, and as a result the violation will be 
committed.


If anyone has a suggestion for how I can achieve the desired goal within 
the constraints of the 2.4.2 version of git-stash.sh, I'd love to hear 
it. Otherwise, I'd like to ask for this patch to be reconsidered.


Thank you,

Jonathan Kamens

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html