From: Neal Kreitzinger <nkreitzinger@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Neal Kreitzinger <neal@rsss.com>, git@vger.kernel.org
Subject: Re: post-update to stash after push to non-bare current branch
Date: Wed, 18 Jan 2012 18:32:57 -0600 [thread overview]
Message-ID: <4F1764B9.90907@gmail.com> (raw)
In-Reply-To: <7vwr8oljq7.fsf@alter.siamese.dyndns.org>
On 1/18/2012 4:38 PM, Junio C Hamano wrote:
> Neal Kreitzinger<nkreitzinger@gmail.com> writes:
>
>> hooks/post-update is:
>>
>> git stash save
>> echo "worktree+index of non-bare remote current branch stashed for safety"
>> git reset --hard
>> echo "git-reset --hard on current remote branch to ensure clean state"
>>
>> message is echoed, but git-reset --hard does not appear to have really
>> worked. (git 1.7.1)
>
> Have you checked where in the filesystem hierarchy that script is run
> (hint: pwd)?
>
echo pwd in post-update echoes /path/WORKTREE/.git in git-push stdout.
> Also it is unclear why you keep saying "stash". What kind of changes are
> you expecting to be saved to the stash? Will they be changes that are not
> source controlled that you would rather not to see? In other words, after
> running "stash" every time somebody pushes and having accumulated many
> stash entries, when do you plan to pop these stashed changes?
>
good point. rejection of dirty worktree is a cleaner safety.
> I would have expect that such a repository to reject a push if the working
> tree is dirty, and run checkout in post-update, though.
>
'git-checkout -f' works manually, but in post-update hook it leaves
behind dirty worktree, ie. index and HEAD match, but worktree still
matches HEAD@{1}. This is the same undesired result git-stash and
git-reset --hard leave behind when executed in post-update hook.
v/r,
neal
next prev parent reply other threads:[~2012-01-19 0:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-18 17:53 post-update to stash after push to non-bare current branch Neal Kreitzinger
2012-01-18 18:33 ` Neal Kreitzinger
2012-01-18 18:51 ` Neal Kreitzinger
2012-01-18 22:38 ` Junio C Hamano
2012-01-19 0:32 ` Neal Kreitzinger [this message]
2012-01-19 1:00 ` Junio C Hamano
2012-01-19 21:48 ` Neal Kreitzinger
2012-01-21 0:13 ` Neal Kreitzinger
2012-01-21 0:16 ` Junio C Hamano
2012-01-21 0:35 ` Neal Kreitzinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F1764B9.90907@gmail.com \
--to=nkreitzinger@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=neal@rsss.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).