Re: [git-users] Question for Git users

2016-05-16 Thread Konstantin Khomoutov
On Mon, 16 May 2016 11:39:00 -0700 (PDT)
"'Holly Dwyer' via Git for human beings" 
wrote:

> My question pertains more to *who* uses Git rather than *how* to use
> Git. I'm a recruiter, partnering with clients to help them find the
> best in DevOps & Cloud Engineering talent. Can anyone suggest a forum
> to post openings? Where do you go when you're looking for a new role?

I'd probably suggest to reach for Stackoverflow Careers.

Also posting a short no-fluff message with openings to this list and to
the main Git list [1] won't probably hurt.

Not sure if Reddit and Hacker News sites have features to post openings
but you could research that -- they definitely have lots of geeks
flocked around them.

1. https://gist.github.com/tfnico/4441562

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Question for Git users

2016-05-16 Thread 'Holly Dwyer' via Git for human beings
My question pertains more to *who* uses Git rather than *how* to use Git. 
I'm a recruiter, partnering with clients to help them find the best in 
DevOps & Cloud Engineering talent. Can anyone suggest a forum to post 
openings? Where do you go when you're looking for a new role?
Thanks!

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: Need help in Git

2016-05-16 Thread Konstantin Khomoutov
On Mon, 16 May 2016 19:56:20 +0300
Konstantin Khomoutov  wrote:

[...]
> Something along this lines could be a good start:
> 
>   #!/bin/sh
>   
>   set -e -u
>   
>   while read _ our _ their; do
> out=`git diff --name-status --diff-filter=D $their $our`
> test -z "$out" && exit 1
>   done
>   exit 0

Sorry, the test should be

  test -z "$out" || exit 1

of course, that is, exit with code 1 if the string in the variable
"out" is *not* empty -- meaning `git diff` actually found deleted files.


On a side note, please take into account that you (and whoever else
about to use this solution) should be well aware of its implications.

The thing is, Git does not explicitly track renames, and renames are
detected by using a (tunable) heuristics.  In unfortunate cases (the
file has been renamed and heavily modified at the same time or the file
was renamed without any modifications at all) those heuristics run by
`git diff` might legitimately fail to detect the rename and the case
will be considered by `git diff` as one file being deleted and another
one added. Obviously, this case will not pass the check in your pre-push
hook.

If this problem might apply to your problem, read up on "-M", "-C" and
"--find-copies-harder" command-line options in the `git diff` manual
page.

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Re: Need help in Git

2016-05-16 Thread Konstantin Khomoutov
On Mon, 16 May 2016 08:10:32 -0700 (PDT)
Sanjiv Kumar  wrote:

> > I wanted to avoid push if any of the files is deleted from the
> > local git clone area. Can anyone please help me with that?
> >
> > I am using Stash for repository management.
>
> On our side we need to reject the push if any file is deleted.

OK, so you need to write and install a pre-push hook in your local
repository.

Start with reading the githooks manual page (run `git help hooks`).

The hook is a program (or, in the simplest case, a script) which gets
run when some specific event happens in the repository.  The Git
instance which is running the hook communicates with the process
running it via the command-line parameters and standard input stream.
The hook communicates with Git via its exit code; whatever it prints
to its standard output and error streams is sent to the client.
The section describing each kind of hook in the manual page describes
what exactly is submitted to the hooks of that kind, and what is
expected in exchange.

Exiting with a non-zero exit code from the pre-push hook fails the
operation, and no push will be attempted.  This is what you're after.

Now you need to write the hook's code.

The hook gets passed one or more lines describing what is about to be
pushed, and what data to update with the push.  See the manual for more
details.

IMO the simplest thing you can do is to is to run `git diff` for each
input line and catch with it any change which deleted any files.

Something along this lines could be a good start:

  #!/bin/sh
  
  set -e -u
  
  while read _ our _ their; do
out=`git diff --name-status --diff-filter=D $their $our`
test -z "$out" && exit 1
  done
  exit 0

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Re: Need help in Git

2016-05-16 Thread Sanjiv Kumar
On our side we need to reject the push if any file is deleted.


On Monday, May 16, 2016 at 5:18:57 PM UTC+5:30, Sanjiv Kumar wrote:
>
> Hi All,
>
> I wanted to avoid push if any of the files is deleted from the local git 
> clone area. Can anyone please help me with that?
>
> I am using Stash for repository management.
>
> Thanks,
> Sanjiv
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Need help in Git

2016-05-16 Thread Konstantin Khomoutov
On Mon, 16 May 2016 07:01:16 -0700 (PDT)
Sanjiv Kumar  wrote:

> > > I wanted to avoid push if any of the files is deleted from the
> > > local git clone area. Can anyone please help me with that? 
> > > 
> > > I am using Stash for repository management. 
> >
> > It's not clear where exactly you want to prevent such pushes. 
> >
> > Do you mean rejecting them in the receiving repository or your
> > local one? 
> >
> Rejecting them pushing to remote central repository.

I do understand the intent.

*Where* do you want to reject such a push: on "our" side -- which does
pushing -- or on "their" side -- which receives our push?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Need help in Git

2016-05-16 Thread Sanjiv Kumar
Rejecting them pushing to remote central repository.


On Monday, May 16, 2016 at 6:37:47 PM UTC+5:30, Konstantin Khomoutov wrote:
>
> On Mon, 16 May 2016 04:48:57 -0700 (PDT) 
> Sanjiv Kumar > wrote: 
>
> > I wanted to avoid push if any of the files is deleted from the local 
> > git clone area. Can anyone please help me with that? 
> > 
> > I am using Stash for repository management. 
>
> It's not clear where exactly you want to prevent such pushes. 
>
> Do you mean rejecting them in the receiving repository or your local 
> one? 
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [git-users] Need help in Git

2016-05-16 Thread Konstantin Khomoutov
On Mon, 16 May 2016 04:48:57 -0700 (PDT)
Sanjiv Kumar  wrote:

> I wanted to avoid push if any of the files is deleted from the local
> git clone area. Can anyone please help me with that?
> 
> I am using Stash for repository management.

It's not clear where exactly you want to prevent such pushes.

Do you mean rejecting them in the receiving repository or your local
one?

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[git-users] Need help in Git

2016-05-16 Thread Sanjiv Kumar
Hi All,

I wanted to avoid push if any of the files is deleted from the local git 
clone area. Can anyone please help me with that?

I am using Stash for repository management.

Thanks,
Sanjiv

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.