public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Paul Ebermann <Paul-Ebermann@gmx•de>
To: git@vger•kernel.org
Cc: Evan Driscoll <driscoll@cs•wisc.edu>
Subject: Re: Getting git to help my memory
Date: Wed, 06 Jul 2011 00:08:37 +0200	[thread overview]
Message-ID: <4E138B65.5000500@gmx.de> (raw)
In-Reply-To: <loom.20110705T232905-603@post.gmane.org>

Evan Driscoll schrieb:
> I have a somewhat unusual question. I often forget to push after committing,
> and a few times this has come back to bite me. (One time I didn't even really
> realize for a couple months because I was working on other stuff, so
> unraveling the conflicts was "fun".)
> 
> Is there a way I can get git to print a "don't forget to push!" reminder
> after it commits?
> 
> The best way I can think of is to put a post-commit hook in there. I haven't
> tried it but I'd assume it would work, but would have to be on a
> per-repository basis instead of global.

Yes, I just tried this. Here is the output (from adding a file in the test branch):

---
$ git commit 
Don't forget to push!
[test ceabc34] adding test.txt.
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 test.txt
---

The output is a bit hidden here. Maybe coloring would help here a bit.


Is it really intentional that post-commit is called
*before* the informational output here?

I have no idea on how to automatically add the hooks to all
the repositories - AFAIK git clone will not copy these.


Paŭlo

  reply	other threads:[~2011-07-05 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-05 21:34 Getting git to help my memory Evan Driscoll
2011-07-05 22:08 ` Paul Ebermann [this message]
2011-07-05 23:52 ` Ben Walton
2011-07-06  7:52 ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E138B65.5000500@gmx.de \
    --to=paul-ebermann@gmx$(echo .)de \
    --cc=driscoll@cs$(echo .)wisc.edu \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox