git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] post-update hook: update working copy

From
Andreas Ericsson <ae@op5.se>
Date
Nov 2, 2007, 10:34 UTC
Message-ID
<472AFD39.6000006@op5.se>
In-Reply-To
<7vd4ut7948.fsf@gitster.siamese.dyndns.org>
Junio C Hamano wrote:
Show 10 quoted lines
> Sam Vilain <sam.vilain@catalyst.net.nz> writes:
> 
>> Now that git-stash is available, it is not so unsafe to push to a
>> non-bare repository, but care needs to be taken to preserve any dirty
>> working copy or index state.  This hook script does that, using
>> git-stash.
> 
> Honestly, I am reluctant to do things that _encourages_ pushing
> into a live tree.
> 

"Live" and "living" are perhaps two different things here. I for one have something similar, but only for repositories residing on certain servers, where there really must be zero local changes to the working tree.

>  - Who guarantees that the reflog is enabled for the HEAD?
> 

I disable reflogs on that server. There's (hardly ever) any human interaction with the scripts in that repo, so I really, really don't care about reflogs.

>  - Who guarantees that a human user is not actively editing the
>    work tree files without saving?
There are times when one simply doesn't care.

I realize that for my situation, a much simpler script can (and is) used, so I agree with your concerns. The idea that every git repo has a human hacking on it isn't true though, so doing things like this are sometimes useful, timesaving and a real help.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Junio C HamanoNext: Steven Grimm
Message 5 of 6 in “post-update hook: update working copy”
  1. post-update hook: update working copySam Vilain, Nov 2, 2007
  2. Junio C HamanoNov 2, 2007
  3. Sam VilainNov 2, 2007
  4. Junio C HamanoNov 2, 2007
  5. Andreas EricssonNov 2, 2007
  6. Steven GrimmNov 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.