Git development
 help / color / mirror / Atom feed
* Commit template
@ 2005-05-08 19:07 Sean
  2005-05-08 19:16 ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Sean @ 2005-05-08 19:07 UTC (permalink / raw)
  To: Petr Baudis; +Cc: GIT Mailing List

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

Hi Petr,

This adds the ability to have a per repository commit template.  Create a
.git/commit.form file containg  "CG: " and other lines and it will be used
in place of the regular top 3 lines.  This is kind of handy so that you
can include your signed-off-by: with your email etc.

 cg-commit |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

Sean

P.s. Can't inline patches with this mailer.

[-- Attachment #2: cg-commit.patch --]
[-- Type: application/octet-stream, Size: 896 bytes --]

cg-commit: needs update
Index: cg-commit
===================================================================
--- b2ce852fd77209e112e0b53866ca7004e9b0879f/cg-commit  (mode:100755)
+++ uncommitted/cg-commit  (mode:100755)
@@ -67,9 +67,14 @@
 
 LOGMSG=$(mktemp -t gitci.XXXXXX)
 LOGMSG2=$(mktemp -t gitci2.XXXXXX)
-echo CG: ---------------------------------------------------------- >>$LOGMSG
-echo CG: Lines beggining with CG: will be automatically removed     >>$LOGMSG
-echo CG:                                                            >>$LOGMSG
+if [ -e .git/commit.form ]; then
+	cat .git/commit.form >>$LOGMSG
+else
+	{
+	echo "CG: ----------------------------------------------------------"
+	echo "CG: Lines beggining with CG: will be automatically removed"
+	echo "CG:"; } >>$LOGMSG
+fi
 if [ ! "$ignorecache" ]; then
 	if [ ! "${commitfiles[*]}" ]; then
 		echo 'Nothing to commit.' >&2

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

* Re: Commit template
  2005-05-08 19:07 Commit template Sean
@ 2005-05-08 19:16 ` Marcel Holtmann
  2005-05-08 19:20   ` Sean
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2005-05-08 19:16 UTC (permalink / raw)
  To: Sean; +Cc: Petr Baudis, GIT Mailing List

Hi Sean,

> This adds the ability to have a per repository commit template.  Create a
> .git/commit.form file containg  "CG: " and other lines and it will be used
> in place of the regular top 3 lines.  This is kind of handy so that you
> can include your signed-off-by: with your email etc.

I think it is a bad idea to take the CG: into it. Let them be created by
the cg-commit script, because it knows what to do.

The question now is when we should provide that form. For me it only
makes sense if it is not a merge and if no commit message is provided
via command line.

Regards

Marcel



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

* Re: Commit template
  2005-05-08 19:16 ` Marcel Holtmann
@ 2005-05-08 19:20   ` Sean
  2005-05-08 19:30     ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Sean @ 2005-05-08 19:20 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Petr Baudis, GIT Mailing List

On Sun, May 8, 2005 3:16 pm, Marcel Holtmann said:
> Hi Sean,
>
>> This adds the ability to have a per repository commit template.  Create
>> a
>> .git/commit.form file containg  "CG: " and other lines and it will be
>> used
>> in place of the regular top 3 lines.  This is kind of handy so that you
>> can include your signed-off-by: with your email etc.
>
> I think it is a bad idea to take the CG: into it. Let them be created by
> the cg-commit script, because it knows what to do.
>
> The question now is when we should provide that form. For me it only
> makes sense if it is not a merge and if no commit message is provided
> via command line.


Marcel,

Yeah, it was just a quick hack.  You're not forced to put any CG: lines in
the commit template of course, but it will handle it if you do.   Even
with the patch, cg-commit will add addtional CG: lines containing a list
of modified files etc..

Sean



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

* Re: Commit template
  2005-05-08 19:20   ` Sean
@ 2005-05-08 19:30     ` Marcel Holtmann
  2005-05-08 19:57       ` Sean
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2005-05-08 19:30 UTC (permalink / raw)
  To: Sean; +Cc: Petr Baudis, GIT Mailing List

Hi Sean,

> >> This adds the ability to have a per repository commit template.  Create
> >> a
> >> .git/commit.form file containg  "CG: " and other lines and it will be
> >> used
> >> in place of the regular top 3 lines.  This is kind of handy so that you
> >> can include your signed-off-by: with your email etc.
> >
> > I think it is a bad idea to take the CG: into it. Let them be created by
> > the cg-commit script, because it knows what to do.
> >
> > The question now is when we should provide that form. For me it only
> > makes sense if it is not a merge and if no commit message is provided
> > via command line.
>
> Yeah, it was just a quick hack.  You're not forced to put any CG: lines in
> the commit template of course, but it will handle it if you do.   Even
> with the patch, cg-commit will add addtional CG: lines containing a list
> of modified files etc..

if you don't put any CG: lines in the commit template you screw up the
look of the modified files list. So I propose to leave all the CG: lines
additions as they are in cg-commit and only add the template in front of
it.

Regards

Marcel



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

* Re: Commit template
  2005-05-08 19:30     ` Marcel Holtmann
@ 2005-05-08 19:57       ` Sean
  2005-05-08 20:03         ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Sean @ 2005-05-08 19:57 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Petr Baudis, GIT Mailing List

On Sun, May 8, 2005 3:30 pm, Marcel Holtmann said:

Hey Marcel,

> if you don't put any CG: lines in the commit template you screw up the
> look of the modified files list. So I propose to leave all the CG: lines
> additions as they are in cg-commit and only add the template in front of
> it.

Yes, but you're free to make it look however you like.  Here's a sample:

CG: -[DO NOT COMMIT!]-------------------------------------------
CG:
CG: Hey! You don't want to commit here, use a cloned repository!
CG:


and another:

CG: -[USB CHANGES REPO!]----------------------------------------
CG:
CG: Commit only USB changes here!
CG:

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
CG:
CG:

The trailing CG: lines ensure that those added by cg-commit look okay.
It's not perfect, but it's a nice feature.

Sean



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

* Re: Commit template
  2005-05-08 19:57       ` Sean
@ 2005-05-08 20:03         ` Marcel Holtmann
  2005-05-08 20:06           ` Sean
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2005-05-08 20:03 UTC (permalink / raw)
  To: Sean; +Cc: Petr Baudis, GIT Mailing List

Hi Sean,

> > if you don't put any CG: lines in the commit template you screw up the
> > look of the modified files list. So I propose to leave all the CG: lines
> > additions as they are in cg-commit and only add the template in front of
> > it.
> 
> Yes, but you're free to make it look however you like.  Here's a sample:
> 
> CG: -[DO NOT COMMIT!]-------------------------------------------
> CG:
> CG: Hey! You don't want to commit here, use a cloned repository!
> CG:
> 
> 
> and another:
> 
> CG: -[USB CHANGES REPO!]----------------------------------------
> CG:
> CG: Commit only USB changes here!
> CG:
> 
> Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
> CG:
> CG:
> 
> The trailing CG: lines ensure that those added by cg-commit look okay.
> It's not perfect, but it's a nice feature.

my argument is; not to mess up with the CG: lines created by cg-commit.
If you wanna insert a warning then you can of course add additional CG:
lines to the commit template.

Regards

Marcel



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

* Re: Commit template
  2005-05-08 20:03         ` Marcel Holtmann
@ 2005-05-08 20:06           ` Sean
  2005-05-08 20:17             ` Petr Baudis
  0 siblings, 1 reply; 11+ messages in thread
From: Sean @ 2005-05-08 20:06 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Petr Baudis, GIT Mailing List

On Sun, May 8, 2005 4:03 pm, Marcel Holtmann said:

> my argument is; not to mess up with the CG: lines created by cg-commit.
> If you wanna insert a warning then you can of course add additional CG:
> lines to the commit template.

Marcel,

Well, i'd argue that anyone making their own commit should be responsible
for making it look however they like.  Maybe they want to only use only 60
character wide lines and are tired of seeing the notice about CG: being
ignored.  Gives the power user a tad more flexibility.   But I really
don't care much either way.

Sean



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

* Re: Commit template
  2005-05-08 20:06           ` Sean
@ 2005-05-08 20:17             ` Petr Baudis
  2005-05-08 20:36               ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Petr Baudis @ 2005-05-08 20:17 UTC (permalink / raw)
  To: Sean; +Cc: Marcel Holtmann, GIT Mailing List

Dear diary, on Sun, May 08, 2005 at 10:06:31PM CEST, I got a letter
where Sean <seanlkml@sympatico.ca> told me that...
> On Sun, May 8, 2005 4:03 pm, Marcel Holtmann said:
> 
> > my argument is; not to mess up with the CG: lines created by cg-commit.
> > If you wanna insert a warning then you can of course add additional CG:
> > lines to the commit template.
> 
> Marcel,
> 
> Well, i'd argue that anyone making their own commit should be responsible
> for making it look however they like.  Maybe they want to only use only 60
> character wide lines and are tired of seeing the notice about CG: being
> ignored.  Gives the power user a tad more flexibility.   But I really
> don't care much either way.

I'm with Sean on this one - implemented (with current cg-commit, and I
used .git/commit-template file instead), committed, pushed out.

Sean, could you please sign off the patches you send to the mailing list
in the future?

Thanks,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

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

* Re: Commit template
  2005-05-08 20:17             ` Petr Baudis
@ 2005-05-08 20:36               ` Marcel Holtmann
  2005-05-08 20:40                 ` Petr Baudis
  0 siblings, 1 reply; 11+ messages in thread
From: Marcel Holtmann @ 2005-05-08 20:36 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Sean, GIT Mailing List

Hi Petr,

> > > my argument is; not to mess up with the CG: lines created by cg-commit.
> > > If you wanna insert a warning then you can of course add additional CG:
> > > lines to the commit template.
> > 
> > Well, i'd argue that anyone making their own commit should be responsible
> > for making it look however they like.  Maybe they want to only use only 60
> > character wide lines and are tired of seeing the notice about CG: being
> > ignored.  Gives the power user a tad more flexibility.   But I really
> > don't care much either way.
> 
> I'm with Sean on this one - implemented (with current cg-commit, and I
> used .git/commit-template file instead), committed, pushed out.

then please do a "touch .git/commit-template" and call cg-commit. Now
you will see what I mean. It is too easy to screw up.

Why not leave the list of modified files in the hand of the cg-commit
and people that wanna extra text inside their commit-template add
something like:

CG: ---
CG: This is my testing tree, don't commit

This will look much prettier and gives people the same possibilities to
change everything. If you wanna make the modified files list into a full
configurable template, then I think you must introduce place holders.

Also an option to suppress the list of modified files is possible.

Regards

Marcel



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

* Re: Commit template
  2005-05-08 20:36               ` Marcel Holtmann
@ 2005-05-08 20:40                 ` Petr Baudis
  2005-05-08 21:09                   ` Marcel Holtmann
  0 siblings, 1 reply; 11+ messages in thread
From: Petr Baudis @ 2005-05-08 20:40 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: Sean, GIT Mailing List

Dear diary, on Sun, May 08, 2005 at 10:36:57PM CEST, I got a letter
where Marcel Holtmann <marcel@holtmann.org> told me that...
> Hi Petr,
> 
> > > > my argument is; not to mess up with the CG: lines created by cg-commit.
> > > > If you wanna insert a warning then you can of course add additional CG:
> > > > lines to the commit template.
> > > 
> > > Well, i'd argue that anyone making their own commit should be responsible
> > > for making it look however they like.  Maybe they want to only use only 60
> > > character wide lines and are tired of seeing the notice about CG: being
> > > ignored.  Gives the power user a tad more flexibility.   But I really
> > > don't care much either way.
> > 
> > I'm with Sean on this one - implemented (with current cg-commit, and I
> > used .git/commit-template file instead), committed, pushed out.
> 
> then please do a "touch .git/commit-template" and call cg-commit. Now
> you will see what I mean. It is too easy to screw up.

So don't touch .git/commit-template. It's not like it stops working, you
just don't get the top stuff. Which you probably wanted, why would you
touch .git/commit-template otherwise?

> Why not leave the list of modified files in the hand of the cg-commit
> and people that wanna extra text inside their commit-template add
> something like:
> 
> CG: ---
> CG: This is my testing tree, don't commit
> 
> This will look much prettier and gives people the same possibilities to
> change everything.

But you have extra stuff both before and after the list of modified
files.

> If you wanna make the modified files list into a full configurable
> template, then I think you must introduce place holders.

That's what I was thinking about, actually - @@MODIFIED@@ and such, and
it replaces _all_ the CG: stuff. Just decided that I have better things
to do now personally.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor

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

* Re: Commit template
  2005-05-08 20:40                 ` Petr Baudis
@ 2005-05-08 21:09                   ` Marcel Holtmann
  0 siblings, 0 replies; 11+ messages in thread
From: Marcel Holtmann @ 2005-05-08 21:09 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Sean, GIT Mailing List

Hi Petr,

> > > > > my argument is; not to mess up with the CG: lines created by cg-commit.
> > > > > If you wanna insert a warning then you can of course add additional CG:
> > > > > lines to the commit template.
> > > > 
> > > > Well, i'd argue that anyone making their own commit should be responsible
> > > > for making it look however they like.  Maybe they want to only use only 60
> > > > character wide lines and are tired of seeing the notice about CG: being
> > > > ignored.  Gives the power user a tad more flexibility.   But I really
> > > > don't care much either way.
> > > 
> > > I'm with Sean on this one - implemented (with current cg-commit, and I
> > > used .git/commit-template file instead), committed, pushed out.
> > 
> > then please do a "touch .git/commit-template" and call cg-commit. Now
> > you will see what I mean. It is too easy to screw up.
> 
> So don't touch .git/commit-template. It's not like it stops working, you
> just don't get the top stuff. Which you probably wanted, why would you
> touch .git/commit-template otherwise?

maybe I am the only one who sees a problem here and thinks that it is a
mis-design. Let me try one last time to explain it. We speak here about
end users of Cogito, right? They don't know what is inside the scripts
and how they work. So you tell them that they can create a commit
template that will be presented at every commit time. So lets do it.

---snip---
[PATCH]

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---snip---

I would create a file like this and save it as .git/commit-template,
because I don't really know about the CG: lines and actually I don't
really care, because they get deleted anyway. Stupid as I am, I am
expecting now something like this:

---snip---
[PATCH]

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
CG: -----------------------------------------------------------------------
CG: Lines beginning with the CG: prefix are removed automatically
CG:
CG: Modified files:
CG:    Makefile
CG: -----------------------------------------------------------------------
---snip---

But instead I am getting this:

---snip---

[PATCH]

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
CG:
CG: Modified files:
CG:    Makefile
CG: -----------------------------------------------------------------------
---snip---

As an end user, what would you say?

> > Why not leave the list of modified files in the hand of the cg-commit
> > and people that wanna extra text inside their commit-template add
> > something like:
> > 
> > CG: ---
> > CG: This is my testing tree, don't commit
> > 
> > This will look much prettier and gives people the same possibilities to
> > change everything.
> 
> But you have extra stuff both before and after the list of modified
> files.

Adding extra CG: lines in a commit template is only good for reminding
you of something, right? Why else would you add them?

> > If you wanna make the modified files list into a full configurable
> > template, then I think you must introduce place holders.
> 
> That's what I was thinking about, actually - @@MODIFIED@@ and such, and
> it replaces _all_ the CG: stuff. Just decided that I have better things
> to do now personally.

I understand that :)

Regards

Marcel



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

end of thread, other threads:[~2005-05-08 21:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-08 19:07 Commit template Sean
2005-05-08 19:16 ` Marcel Holtmann
2005-05-08 19:20   ` Sean
2005-05-08 19:30     ` Marcel Holtmann
2005-05-08 19:57       ` Sean
2005-05-08 20:03         ` Marcel Holtmann
2005-05-08 20:06           ` Sean
2005-05-08 20:17             ` Petr Baudis
2005-05-08 20:36               ` Marcel Holtmann
2005-05-08 20:40                 ` Petr Baudis
2005-05-08 21:09                   ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox