login
Header Space

 
 

Re: git push to a non-bare repository

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Theodore Tso <tytso@...>
Cc: Junio C Hamano <junkio@...>, git <git@...>
Date: Sunday, March 18, 2007 - 10:56 pm

Theodore Tso <tytso@mit.edu> wrote:

The reflog does update if the log file exists during a push (err,
actually during receive-pack).  Or if core.logAllRefUpdates is set
to true.  Now this isn't the default in a bare repository, but it
should be the default in a repository with a working directory.
So the case we are talking about should be seeing the reflog update.
 

Yes, the update hook can detect this.  Actually receive-pack by
default rejects *all* non-fast-forward pushes, even if the client
side uses --force.


The update hook could also perform this check; test if the ref
being updated is the current branch, and if so, verify the index and
working directory is clean.  That's a simple run of git-symbolic-ref
(to get the current branch) and git-runstatus (to check the index
and working directory), is it not?

If git-runstatus exits to indicate the tree is clean (nothing to
commit) then a simple `read-tree -m -u HEAD $new` should update
the working directory and index, right?

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git push to a non-bare repository, Matthieu Moy, (Sun Mar 18, 1:31 pm)
Re: git push to a non-bare repository, Theodore Tso, (Sun Mar 18, 10:00 pm)
Re: git push to a non-bare repository, Matthieu Moy, (Mon Mar 19, 5:19 am)
Re: git push to a non-bare repository, Junio C Hamano, (Sun Mar 18, 9:55 pm)
Re: git push to a non-bare repository, Shawn O. Pearce, (Sun Mar 18, 10:21 pm)
Re: git push to a non-bare repository, Theodore Tso, (Sun Mar 18, 10:47 pm)
Re: git push to a non-bare repository, Shawn O. Pearce, (Sun Mar 18, 10:56 pm)
Re: git push to a non-bare repository, Theodore Tso, (Sun Mar 18, 11:33 pm)
Re: git push to a non-bare repository, Shawn O. Pearce, (Sun Mar 18, 11:47 pm)
Re: git push to a non-bare repository, Junio C Hamano, (Mon Mar 19, 12:14 am)
Re: git push to a non-bare repository, Theodore Tso, (Sun Mar 18, 11:21 pm)
Re: git push to a non-bare repository, Shawn O. Pearce, (Sun Mar 18, 11:53 pm)
Re: git push to a non-bare repository, Sam Vilain, (Mon Mar 19, 7:58 pm)
Re: git push to a non-bare repository, Junio C Hamano, (Mon Mar 19, 8:49 pm)
Re: git push to a non-bare repository, Junio C Hamano, (Mon Mar 19, 8:54 pm)
Re: git push to a non-bare repository, Nicolas Pitre, (Mon Mar 19, 12:08 am)
Re: git push to a non-bare repository, Theodore Tso, (Mon Mar 19, 2:25 am)
Re: git push to a non-bare repository, Nicolas Pitre, (Mon Mar 19, 11:16 am)
Re: git push to a non-bare repository, Junio C Hamano, (Mon Mar 19, 2:44 am)
Re: git push to a non-bare repository, Nicolas Pitre, (Mon Mar 19, 11:20 am)
Re: git push to a non-bare repository, Junio C Hamano, (Sun Mar 18, 3:47 pm)
Re: git push to a non-bare repository, Sam Vilain, (Sun Mar 18, 5:51 pm)
Re: git push to a non-bare repository, Junio C Hamano, (Sun Mar 18, 6:18 pm)
speck-geostationary