git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Git 2 force commits but Git 1 doesn't
@ 2020-06-22 19:40 Michael Ward
  2020-06-22 20:21 ` brian m. carlson
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Ward @ 2020-06-22 19:40 UTC (permalink / raw)
  To: git

We have some repositories we are hosting here using Apache's DAV module 
to handle remote connections.

The repositories are created using the following:

mkdir [reponame].git
cd [reponame].git
git --bare init
git update-server-info

Our Apache location directive is as follows:

<Location /[reponame].git>
         DAV on
         AuthType Basic
         AuthName "Git"
         AuthBasicProvider ldap
         AuthLDAPUrl [ldap server info]
         <RequireAny>
                 require [ldap filter]
         </RequireAny>
</Location>

The repository config generates with the values in the core section 
below, and we add the receive and advice sections:

[core]
         repositoryformatversion = 0
         filemode = true
         bare = true
[receive]
         denyNonFastForwards = true
         denyDeletes = true
[advice]
         pushFetchFirst = true

The odd behavior comes when we have git 1 vs git 2 clients attempting to 
push in changes on the same branch. Git 1 clients will prompt the user 
that they are out of date and need to pull. Git 2 clients don't and will 
force push and overwrite the head revision. This occurs with either Git 
1 or Git 2 on the server.

We've tested this with the latest Git 2 client on Fedora 32 and Git 1 
client on CentOS 7.8. The other oddity is that even when the Git 2 
client does a pull to receive changes before making changes and pushing, 
when another user pulls the change, there is a message shown that a 
commit was forced.

What am I missing in the repository settings to prevent forced pushes 
from working and force users to pull before being able to push?

Thanks!

Michael Ward

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-06-24 13:05 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 19:40 Git 2 force commits but Git 1 doesn't Michael Ward
2020-06-22 20:21 ` brian m. carlson
2020-06-22 20:30   ` Michael Ward
2020-06-22 20:31     ` Michael Ward
2020-06-22 20:43     ` brian m. carlson
2020-06-22 20:52       ` Michael Ward
2020-06-22 21:09         ` brian m. carlson
2020-06-22 22:17           ` Michael Ward
2020-06-23  1:05             ` brian m. carlson
2020-06-23  8:59               ` René Scharfe
2020-06-23 15:30                 ` brian m. carlson
2020-06-23 16:42                   ` René Scharfe
2020-06-23 19:13                     ` brian m. carlson
2020-06-24 13:05                     ` René Scharfe
2020-06-23 20:21               ` [PATCH] http-push: ensure unforced pushes fail when data would be lost brian m. carlson
2020-06-23 21:28                 ` Eric Sunshine
2020-06-23 21:50                   ` brian m. carlson
2020-06-23 21:52                 ` [PATCH v2] " brian m. carlson
2020-06-23 22:41                   ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).