Re: Server-side preventing some files from being overwritten

2016-07-21 Thread Thorsten Glaser
On Thu, 21 Jul 2016, Jakub Narębski wrote: > Or you can use third-party tools with support for such cases, such Not if the repository is already managed by some other tool (FusionForge, in this case). Thanks anyway, //mirabilos -- tarent solutions GmbH Rochusstraße 2-4, D-53123 Bonn •

Re: Server-side preventing some files from being overwritten

2016-07-21 Thread Jakub Narębski
W dniu 2016-07-14 o 18:57, Stefan Beller pisze: > On Thu, Jul 14, 2016 at 8:31 AM, Thorsten Glaser wrote: >> Hi *, >> >> is there a way, for example with some sort of pre-receive hook, >> to prevent some files from being overwritten by a push? > > pre-receive hooks are a

Re: Server-side preventing some files from being overwritten

2016-07-15 Thread Thorsten Glaser
On Fri, 15 Jul 2016, Ævar Arnfjörð Bjarmason wrote: > I.e. it allows pushing a series which is a series of two commits which: > > 1. Change the forbidden file(s) > 2. Undo changes to the forbidden file(s) That’s precisely allowed. bye, //mirabilos -- tarent solutions GmbH Rochusstraße

Re: Server-side preventing some files from being overwritten

2016-07-15 Thread Ævar Arnfjörð Bjarmason
On Thu, Jul 14, 2016 at 8:44 PM, Junio C Hamano wrote: > On Thu, Jul 14, 2016 at 11:27 AM, Junio C Hamano wrote: >> Thorsten Glaser writes: >> >>> if test x"0" != x"$(comm -23z \ >>> <(git ls-tree -r -z "$old" "$subdir" |

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Junio C Hamano
Thorsten Glaser writes: > On Thu, 14 Jul 2016, Junio C Hamano wrote: > >> Can't this become simpler, e.g. >> >> if ! git diff-tree --quiet "$old" "$new" -- "$subdir" > > Thought about diff-tree, but additions are permitted, diff-tree -r --diff-filter=a "$old"

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Stefan Beller
On Thu, Jul 14, 2016 at 11:44 AM, Junio C Hamano wrote: > On Thu, Jul 14, 2016 at 11:27 AM, Junio C Hamano wrote: >> Thorsten Glaser writes: >> >>> if test x"0" != x"$(comm -23z \ >>> <(git ls-tree -r -z "$old" "$subdir"

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Thorsten Glaser
On Thu, 14 Jul 2016, Junio C Hamano wrote: > Can't this become simpler, e.g. > > if ! git diff-tree --quiet "$old" "$new" -- "$subdir" Thought about diff-tree, but additions are permitted, and diffing the actual file content has overhead too. Just counting the number of object hashes

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Junio C Hamano
On Thu, Jul 14, 2016 at 11:27 AM, Junio C Hamano wrote: > Thorsten Glaser writes: > >> if test x"0" != x"$(comm -23z \ >> <(git ls-tree -r -z "$old" "$subdir" | sort -z) \ >> <(git ls-tree -r -z "$new" "$subdir" | sort -z) | wc

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Junio C Hamano
Thorsten Glaser writes: > Although I’m ordinarily loath to write GNU bash scripts, this > helps avoiding temporary files. This works: > > -cutting here may damage your screen surface- > #!/bin/bash > export LC_ALL=C > subdir=x/y > while IFS=' ' read -r old new name;

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Thorsten Glaser
On Thu, 14 Jul 2016, Stefan Beller wrote: > go roughly like Thanks, that did the trick! Although I’m ordinarily loath to write GNU bash scripts, this helps avoiding temporary files. This works: -cutting here may damage your screen surface- #!/bin/bash export LC_ALL=C subdir=x/y while

Re: Server-side preventing some files from being overwritten

2016-07-14 Thread Stefan Beller
On Thu, Jul 14, 2016 at 8:31 AM, Thorsten Glaser wrote: > Hi *, > > is there a way, for example with some sort of pre-receive hook, > to prevent some files from being overwritten by a push? pre-receive hooks are a thing! pre-receive This hook is invoked by

Server-side preventing some files from being overwritten

2016-07-14 Thread Thorsten Glaser
Hi *, is there a way, for example with some sort of pre-receive hook, to prevent some files from being overwritten by a push? Use case: In some project, we use Flyway to manage the database schema, and Jenkins to automatically build master’s HEAD after each push (and install it, thus activating