git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Add support for commit.signoff config option
@ 2006-11-28 12:02 Andy Parkins
  2006-11-28 20:17 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2006-11-28 12:02 UTC (permalink / raw
  To: git

Whether patches require signing off or not is probably a per-project
setting rather than a per-commit setting.  Therefore as a convenience to
the user, the commit.signoff setting will automtically add --signoff to
commits.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---

 git-commit.sh |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/git-commit.sh b/git-commit.sh
index 81c3a0c..c45af10 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -66,9 +66,7 @@ trap '
 	rm -f "$NEXT_INDEX"
 ' 0
 
-################################################################
-# Command line argument parsing and sanity checking
-
+# Init
 all=
 also=
 only=
@@ -85,6 +83,17 @@ signoff=
 force_author=
 only_include_assumed=
 untracked_files=
+
+# Config
+case "$(git-repo-config --get commit.signoff)" in
+1|on|yes|true)
+	signoff=t
+	;;
+esac
+
+################################################################
+# Command line argument parsing and sanity checking
+
 while case "$#" in 0) break;; esac
 do
 	case "$1" in
-- 
1.4.3.GIT-dirty

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

* Re: [PATCH] Add support for commit.signoff config option
  2006-11-28 12:02 [PATCH] Add support for commit.signoff config option Andy Parkins
@ 2006-11-28 20:17 ` Junio C Hamano
  2006-11-29  8:25   ` [PATCH] Add --bool and --int to the OPTIONS section Andy Parkins
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2006-11-28 20:17 UTC (permalink / raw
  To: Andy Parkins; +Cc: git

Andy Parkins <andyparkins@gmail.com> writes:

> Whether patches require signing off or not is probably a per-project
> setting rather than a per-commit setting.  Therefore as a convenience to
> the user, the commit.signoff setting will automtically add --signoff to
> commits.
>
> Signed-off-by: Andy Parkins <andyparkins@gmail.com>

I muttered something about commit templates which would make
this change a moot point, but independent of that...

> +# Config
> +case "$(git-repo-config --get commit.signoff)" in
> +1|on|yes|true)
> +	signoff=t
> +	;;
> +esac

this is ugly; please use --bool and check only for 'true'.



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

* [PATCH] Add --bool and --int to the OPTIONS section
  2006-11-28 20:17 ` Junio C Hamano
@ 2006-11-29  8:25   ` Andy Parkins
  2006-11-29 10:09     ` Johannes Schindelin
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2006-11-29  8:25 UTC (permalink / raw
  To: git

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
I did look for just such an option, but didn't find it because it wasn't in 
the OPTIONS list of the git-repo-config man page.  If there is an OPTIONS 
section it should include all options, otherwise it's no use as a quick 
reference.

Your template commit message is an excellent idea, but I don't like the idea 
of simply hard coding sign off line into it; it means that there are then two 
locations in the .git tree that I'd have to edit to change my name.  
Therefore any template would have to support token expansion so that "S-o-B: 
$REPOSITORY_EMAIL" would be possible.  Even better would be support 
for "$GIT_STATUS_OUTPUT" and "$GIT_DIFF_OUTPUT" so that the commit message is 
completely templated.

 Documentation/git-repo-config.txt |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-repo-config.txt 
b/Documentation/git-repo-config.txt
index 8199615..5bede9a 100644
--- a/Documentation/git-repo-config.txt
+++ b/Documentation/git-repo-config.txt
@@ -77,6 +77,12 @@ OPTIONS
 -l, --list::
 	List all variables set in config file.
 
+--bool::
+	git-repo-config will ensure that the output is "true" or "false"
+
+--int::
+	git-repo-config will ensure that the output is a simple decimal number
+
 
 ENVIRONMENT
 -----------
-- 
1.4.3.GIT-dirty

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

* Re: [PATCH] Add --bool and --int to the OPTIONS section
  2006-11-29  8:25   ` [PATCH] Add --bool and --int to the OPTIONS section Andy Parkins
@ 2006-11-29 10:09     ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2006-11-29 10:09 UTC (permalink / raw
  To: Andy Parkins; +Cc: git

Hi,

On Wed, 29 Nov 2006, Andy Parkins wrote:

> Signed-off-by: Andy Parkins <andyparkins@gmail.com>
> ---

You might want to use a more-to-the-point subject, and move this into the 
commit message:

> I did look for just such an option, but didn't find it because it wasn't 
> in the OPTIONS list of the git-repo-config man page.  If there is an 
> OPTIONS section it should include all options, otherwise it's no use as 
> a quick reference.

And this belongs into another mail:

> Your template commit message is an excellent idea, but I don't like the idea 
> of simply hard coding sign off line into it; it means that there are then two 
> locations in the .git tree that I'd have to edit to change my name. 
> [...]

But to answer your concern: you would do this as a hook, which is a script 
in which you do not put your name directly. Rather, this script gets the 
current author name by calling either git-var or git-repo-config.

Ciao,
Dscho

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

end of thread, other threads:[~2006-11-29 10:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-28 12:02 [PATCH] Add support for commit.signoff config option Andy Parkins
2006-11-28 20:17 ` Junio C Hamano
2006-11-29  8:25   ` [PATCH] Add --bool and --int to the OPTIONS section Andy Parkins
2006-11-29 10:09     ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).