* [GUILT] Preventing "git push" when guilt patches are applied
@ 2012-04-19 7:23 Per Cederqvist
2012-04-19 15:19 ` Junio C Hamano
0 siblings, 1 reply; 3+ messages in thread
From: Per Cederqvist @ 2012-04-19 7:23 UTC (permalink / raw)
To: git; +Cc: cederp, ceder
I have by accident done "git push" when I intended to write "guilt
push" a couple of times. If there are guilt patches applied when I do
this the result is that (part of) my half-finished patch series is
pushed to the master branch. That is of course not good.
TopGit avoids this issue since I'm on a separate branch when patches
are applied.
Mercurial Queues prevents this. If I try to do "hg push" with a patch
applied, I get this error:
> pushing to /home/cederp/pushstop/hgmaster
> abort: source has mq patches applied
I'd like to add something similar to Guilt, to avoid making this
mistake ever again. (It is quite embarrassing to clean up after you
push a couple of half-baked patches.) But I don't know how the
feature should be designed. Some ideas:
- Add pre-push hooks to Git, like the one proposed back in 2008 in
<http://thread.gmane.org/gmane.comp.version-control.git/92900>.
Have Guilt automatically install a pre-push hook that produces an
error message if Guilt patches are applied.
- Have Guilt create a status file (maybe .git/PUSH_FORBIDDEN)
whenever patches are applied, and remove the file when it pops all
patches. The file would contain the following text: "Refusing to
push while guilt patches are applied. Hint: see 'guilt -h
commit'." Have "git push" check for that file, and print its
contents if it exists. (Or should "git push" check for any file
matching the glob pattern ".git/PUSH_FORBIDDEN.*" and Guilt create
.git/PUSH_FORBIDDEN.Guilt so that this mechanism is more
extensible?)
- Have Guilt remove all remotes when patches are pushed, and restore
them when all patches are popped. (I don't like this idea; there
are too many things that could go wrong. But it would be possible
to implement without doing any changes to Git itself.)
I hope the Git community can come up with a better design for this
feature.
/ceder
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [GUILT] Preventing "git push" when guilt patches are applied
2012-04-19 7:23 [GUILT] Preventing "git push" when guilt patches are applied Per Cederqvist
@ 2012-04-19 15:19 ` Junio C Hamano
2012-04-30 10:34 ` Per Cederqvist
0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2012-04-19 15:19 UTC (permalink / raw)
To: Per Cederqvist; +Cc: git, ceder
On Thu, Apr 19, 2012 at 12:23 AM, Per Cederqvist <cederp@opera.com> wrote:
> I have by accident done "git push" when I intended to write "guilt
> push" a couple of times. If there are guilt patches applied when I do
> this the result is that (part of) my half-finished patch series is
> pushed to the master branch. That is of course not good.
>
> TopGit avoids this issue since I'm on a separate branch when patches
> are applied.
> ...
> I'd like to add something similar to Guilt, to avoid making this
> mistake ever again. (It is quite embarrassing to clean up after you
> push a couple of half-baked patches.) But I don't know how the
> feature should be designed. Some ideas:
> ...
Isn't the most obvious one (somehow missing from your list) from your
observation you
described earlier to have guilt apply patches on a separate branch?
Would it also work to set "[push] default = none"? Then "git push"
typed by mistake for
"guilt push" (I am assuming that "$whichever push" does not take any
other argument,
and that is the root cause of your fat-finger-embarrassment issue)
would not push anything
out.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [GUILT] Preventing "git push" when guilt patches are applied
2012-04-19 15:19 ` Junio C Hamano
@ 2012-04-30 10:34 ` Per Cederqvist
0 siblings, 0 replies; 3+ messages in thread
From: Per Cederqvist @ 2012-04-30 10:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, ceder
On 04/19/2012 05:19 PM, Junio C Hamano wrote:
> On Thu, Apr 19, 2012 at 12:23 AM, Per Cederqvist<cederp@opera.com> wrote:
>> I have by accident done "git push" when I intended to write "guilt
>> push" a couple of times. If there are guilt patches applied when I do
>> this the result is that (part of) my half-finished patch series is
>> pushed to the master branch. That is of course not good.
>>
>> TopGit avoids this issue since I'm on a separate branch when patches
>> are applied.
>> ...
>> I'd like to add something similar to Guilt, to avoid making this
>> mistake ever again. (It is quite embarrassing to clean up after you
>> push a couple of half-baked patches.) But I don't know how the
>> feature should be designed. Some ideas:
>> ...
>
> Isn't the most obvious one (somehow missing from your list) from your
> observation you
> described earlier to have guilt apply patches on a separate branch?
It wasn't obvious to me, but I think it is a good idea. I've posted
an implementation of this here:
http://thread.gmane.org/gmane.comp.version-control.git/196546
> Would it also work to set "[push] default = none"? Then "git push"
> typed by mistake for
> "guilt push" (I am assuming that "$whichever push" does not take any
> other argument,
> and that is the root cause of your fat-finger-embarrassment issue)
> would not push anything
> out.
That would maybe help me, but I would still be reluctant to recommend
Guilt to my friends, as I don't want to be the reason they make stupid
mistakes. :-)
/ceder
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-30 10:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-19 7:23 [GUILT] Preventing "git push" when guilt patches are applied Per Cederqvist
2012-04-19 15:19 ` Junio C Hamano
2012-04-30 10:34 ` Per Cederqvist
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.