git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFE] pre/post-stash hooks
@ 2010-02-19 17:33 Scott R. Godin
  2010-02-24 19:31 ` Scott R. Godin
  0 siblings, 1 reply; 3+ messages in thread
From: Scott R. Godin @ 2010-02-19 17:33 UTC (permalink / raw)
  To: git

While I had known about git stash, and just never used it, I'd finally 
gotten to the point where it was needed, only to discover something that 
I found interesting.

My use case may a bit rare at the moment, I'll admit, but not at all 
far-fetched, and probably growing in usage as time goes on.

In contrib/hooks is the script 'setgitperms.perl' which, when added to 
pre-commit, post-merge, and post-checkout, makes sure to track the file 
permissions fully, not just +/-x. This can be vitally important for 
webdevelopers who must keep certain permissions on certain directories, 
such as for e-commerce solutions like Magento, etc, so that the clients 
may upload new product images through the interface rather than via ftp.

However when I recently used stash to push some changes aside while I 
did something else first, and then ran git stash pop, I realized that 
there weren't any hooks that would enable setgitperms.perl to be 
ensuring/tracking the file permissions are applied correctly after stash 
usage.

Granted that full directory/file permissions may not be all that 
important to some of you coders, but I can assure you that web 
developers may not see it that way.

Again granted, I could probably set up a Makefile, but not everyone 
knows how to do that (particularly those webdevelopers who aren't coders 
who would typically be familiar with Makefiles.

Also granted I could probably find a way to work around this issue with 
an alias, but my thought is that I shouldn't have to.

There are some of us who exist who have this funny thought that 
computers should be able to do things for us without us having to 
explicitly tell them to, specifically, every time. We'd prefer to set 
things up generally "just do this EVERY time for EVERYthing" and forget 
about it, and let the computer handle it. I'm sure you're familiar with 
us, since we are us. :-)

So, with this in mind, in addition to requesting pre/post-stash hooks 
just for this alone, I'd like to solicit some thought from the rest of 
you as to potential possible usages/requirements for said hooks for 
reasons _other_ than running 'setgitperms.perl'

Are there any reasons why pre/post-stash hooks _shouldn't_ exist?

How difficult would it be to implement?

-- 
(please respond to the list as opposed to my email box directly,
unless you are supplying private information you don't want public
on the list)

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

* Re: [RFE] pre/post-stash hooks
  2010-02-19 17:33 [RFE] pre/post-stash hooks Scott R. Godin
@ 2010-02-24 19:31 ` Scott R. Godin
  2010-02-25  1:34   ` Chris Packham
  0 siblings, 1 reply; 3+ messages in thread
From: Scott R. Godin @ 2010-02-24 19:31 UTC (permalink / raw)
  To: git

giving this a bump since I haven't received any replies on it yet, and 
it's a valid question, IMHO.

On 02/19/2010 12:33 PM, Scott R. Godin wrote:
> While I had known about git stash, and just never used it, I'd finally
> gotten to the point where it was needed, only to discover something that
> I found interesting.
>
> My use case may a bit rare at the moment, I'll admit, but not at all
> far-fetched, and probably growing in usage as time goes on.
>
> In contrib/hooks is the script 'setgitperms.perl' which, when added to
> pre-commit, post-merge, and post-checkout, makes sure to track the file
> permissions fully, not just +/-x. This can be vitally important for
> webdevelopers who must keep certain permissions on certain directories,
> such as for e-commerce solutions like Magento, etc, so that the clients
> may upload new product images through the interface rather than via ftp.
>
> However when I recently used stash to push some changes aside while I
> did something else first, and then ran git stash pop, I realized that
> there weren't any hooks that would enable setgitperms.perl to be
> ensuring/tracking the file permissions are applied correctly after stash
> usage.
>
> Granted that full directory/file permissions may not be all that
> important to some of you coders, but I can assure you that web
> developers may not see it that way.
>
> Again granted, I could probably set up a Makefile, but not everyone
> knows how to do that (particularly those webdevelopers who aren't coders
> who would typically be familiar with Makefiles.
>
> Also granted I could probably find a way to work around this issue with
> an alias, but my thought is that I shouldn't have to.
>
> There are some of us who exist who have this funny thought that
> computers should be able to do things for us without us having to
> explicitly tell them to, specifically, every time. We'd prefer to set
> things up generally "just do this EVERY time for EVERYthing" and forget
> about it, and let the computer handle it. I'm sure you're familiar with
> us, since we are us. :-)
>
> So, with this in mind, in addition to requesting pre/post-stash hooks
> just for this alone, I'd like to solicit some thought from the rest of
> you as to potential possible usages/requirements for said hooks for
> reasons _other_ than running 'setgitperms.perl'
>
> Are there any reasons why pre/post-stash hooks _shouldn't_ exist?
>
> How difficult would it be to implement?
>


-- 
(please respond to the list as opposed to my email box directly,
unless you are supplying private information you don't want public
on the list)

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

* Re: [RFE] pre/post-stash hooks
  2010-02-24 19:31 ` Scott R. Godin
@ 2010-02-25  1:34   ` Chris Packham
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Packham @ 2010-02-25  1:34 UTC (permalink / raw)
  To: Scott R. Godin; +Cc: git

On Wed, Feb 24, 2010 at 11:31 AM, Scott R. Godin
<scottg.wp-hackers@mhg2.com> wrote:
> giving this a bump since I haven't received any replies on it yet, and it's
> a valid question, IMHO.
>
> On 02/19/2010 12:33 PM, Scott R. Godin wrote:
>>
>> While I had known about git stash, and just never used it, I'd finally
>> gotten to the point where it was needed, only to discover something that
>> I found interesting.
>>
>> My use case may a bit rare at the moment, I'll admit, but not at all
>> far-fetched, and probably growing in usage as time goes on.
>>
>> In contrib/hooks is the script 'setgitperms.perl' which, when added to
>> pre-commit, post-merge, and post-checkout, makes sure to track the file
>> permissions fully, not just +/-x. This can be vitally important for
>> webdevelopers who must keep certain permissions on certain directories,
>> such as for e-commerce solutions like Magento, etc, so that the clients
>> may upload new product images through the interface rather than via ftp.
>>
>> However when I recently used stash to push some changes aside while I
>> did something else first, and then ran git stash pop, I realized that
>> there weren't any hooks that would enable setgitperms.perl to be
>> ensuring/tracking the file permissions are applied correctly after stash
>> usage.
>>
>> Granted that full directory/file permissions may not be all that
>> important to some of you coders, but I can assure you that web
>> developers may not see it that way.
>>
>> Again granted, I could probably set up a Makefile, but not everyone
>> knows how to do that (particularly those webdevelopers who aren't coders
>> who would typically be familiar with Makefiles.
>>
>> Also granted I could probably find a way to work around this issue with
>> an alias, but my thought is that I shouldn't have to.
>>
>> There are some of us who exist who have this funny thought that
>> computers should be able to do things for us without us having to
>> explicitly tell them to, specifically, every time. We'd prefer to set
>> things up generally "just do this EVERY time for EVERYthing" and forget
>> about it, and let the computer handle it. I'm sure you're familiar with
>> us, since we are us. :-)
>>
>> So, with this in mind, in addition to requesting pre/post-stash hooks
>> just for this alone, I'd like to solicit some thought from the rest of
>> you as to potential possible usages/requirements for said hooks for
>> reasons _other_ than running 'setgitperms.perl'
>>
>> Are there any reasons why pre/post-stash hooks _shouldn't_ exist?
>>
>> How difficult would it be to implement?
>>

Well for my 2 cents I've always seen stash as a way to prevent me
having to deal with a commit/merge right now when I get
interrupted/distracted. The things I stash usually don't work and
aren't complete, otherwise I would have committed them. Which really
is my answer to your question, pre-commit hooks exist so anything that
needs to be guaranteed in an automated way can still be done when it
really matters. As a git user I wouldn't find pre/post stash hooks
useful because its not something I'd use in my work-flow. But if it's
your itch go for it, don't let me put you off from floating a patch on
the list.

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

end of thread, other threads:[~2010-02-25  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-19 17:33 [RFE] pre/post-stash hooks Scott R. Godin
2010-02-24 19:31 ` Scott R. Godin
2010-02-25  1:34   ` Chris Packham

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 NNTP newsgroup(s).