Ferry Huberts | 23 Mar 2011 11:57
Gravatar

[PATCH v4 2/5] cgit_open_filter: also take the repo as a parameter

From: Ferry Huberts <ferry.huberts@...>

To prepare for handing repo configuration to the
filter script that is executed.

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgit.h        |    2 +-
 shared.c      |    2 +-
 ui-commit.c   |    6 +++---
 ui-repolist.c |    2 +-
 ui-snapshot.c |    2 +-
 ui-summary.c  |    2 +-
 ui-tree.c     |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cgit.h b/cgit.h
index 1f8b1be..3b0eaf5 100644
--- a/cgit.h
+++ b/cgit.h
 <at>  <at>  -318,7 +318,7  <at>  <at>  extern const char *cgit_repobasename(const char *reponame);

 extern int cgit_parse_snapshots_mask(const char *str);

-extern int cgit_open_filter(struct cgit_filter *filter);
+extern int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo);
 extern int cgit_close_filter(struct cgit_filter *filter);

 extern int readfile(const char *path, char **buf, size_t *size);
diff --git a/shared.c b/shared.c
(Continue reading)

Ferry Huberts | 23 Mar 2011 11:57
Gravatar

[PATCH v4 1/5] new_filter: determine extra_args from filter type

From: Ferry Huberts <ferry.huberts@...>

Currently the number of extra arguments is linked hard to the type of
the filter. This is also logical since it would be confusing to have
a different number of arguments for the same type of filter depending
on the context under which the filter is run (unless ofcourse one the
parameters would make the context clear, which is currently not the
case).

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgit.c |   27 ++++++++++++++++++++-------
 cgit.h |    4 ++++
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/cgit.c b/cgit.c
index f4dd6ef..5d6e488 100644
--- a/cgit.c
+++ b/cgit.c
 <at>  <at>  -26,13 +26,26  <at>  <at>  void add_mimetype(const char *name, const char *value)
 	item->util = xstrdup(value);
 }

-struct cgit_filter *new_filter(const char *cmd, int extra_args)
+struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
 {
 	struct cgit_filter *f;
+	int extra_args;

 	if (!cmd || !cmd[0])
(Continue reading)

Ferry Huberts | 23 Mar 2011 11:57
Gravatar

[PATCH v3 0/4] Hand the repo configuration to the filters

From: Ferry Huberts <ferry.huberts@...>

Changes compared to v3:
- Incorporated feedback from Lars

Changes compared to v2:
- Split out the first 2 patches into a seperate thread
- Incorporated feedback from Lars

Changes compared to v1:
- Rewritten to hand the repo configuration via environment variables

I have a server setup in which each repo has a trac instance and
for the commit filter I really need to know with which repo I'm
dealing in order to be able to resolve the #123 ticket numbers
into hyperlinks into the correct trac instance.

Lars, patch 3 has become quite a bit more complex. However, adding
      environment variables is a matter of simply extending the
      env_vars array in the prepare_env function; only the code
      that processes that array has become a bit more complex.

Ferry Huberts (5):
  new_filter: determine extra_args from filter type
  cgit_open_filter: also take the repo as a parameter
  cgit_open_filter: hand down repo configuration to script
  filters: document environment variables in filter scripts
  debug logging

 cgit.c                         |   27 +++++++--
(Continue reading)

Ferry Huberts | 23 Mar 2011 11:57
Gravatar

[PATCH v4 3/5] cgit_open_filter: hand down repo configuration to script

From: Ferry Huberts <ferry.huberts@...>

The environment variables can be used to (for example) resolve
the following situation:

Suppose a server setup in which each repository has a trac
instance; the commit filter needs to know with which
repository it's dealing in order to be able to resolve the
#123 ticket numbers in the commit messages into hyperlinks
into the correct trac instance.

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 shared.c |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 77 insertions(+), 1 deletions(-)

diff --git a/shared.c b/shared.c
index e4879df..8c3d18a 100644
--- a/shared.c
+++ b/shared.c
 <at>  <at>  -7,6 +7,8  <at>  <at> 
  */

 #include "cgit.h"
+#include <stdio.h>
+#include <linux/limits.h>

 struct cgit_repolist cgit_repolist;
 struct cgit_context ctx;
 <at>  <at>  -376,6 +378,70  <at>  <at>  int cgit_parse_snapshots_mask(const char *str)
(Continue reading)

Ferry Huberts | 23 Mar 2011 11:57
Gravatar

[PATCH v4 4/5] filters: document environment variables in filter scripts

From: Ferry Huberts <ferry.huberts@...>

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgitrc.5.txt                   |   47 +++++++++++++++++++++++++++++++++++----
 filters/commit-links.sh        |   11 +++++++++
 filters/syntax-highlighting.sh |   11 +++++++++
 3 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index c3698a6..60539d7 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
 <at>  <at>  -31,7 +31,7  <at>  <at>  about-filter::
 	about pages (both top-level and for each repository). The command will
 	get the content of the about-file on its STDIN, and the STDOUT from the
 	command will be included verbatim on the about page. Default value:
-	none.
+	none. See also: "FILTER API".

 agefile::
 	Specifies a path, relative to each repository path, which can be used
 <at>  <at>  -81,6 +81,7  <at>  <at>  commit-filter::
 	The command will get the message on its STDIN, and the STDOUT from the
 	command will be included verbatim as the commit message, i.e. this can
 	be used to implement bugtracker integration. Default value: none.
+	See also: "FILTER API".

 css::
 	Url which specifies the css document to include in all cgit pages.
(Continue reading)

Ferry Huberts | 23 Mar 2011 15:03
Gravatar

[PATCH v4 0/4] Hand the repo configuration to the filters

From: Ferry Huberts <ferry.huberts@...>

Changes compared to v3:
- Incorporated feedback from Lars

Changes compared to v2:
- Split out the first 2 patches into a seperate thread
- Incorporated feedback from Lars

Changes compared to v1:
- Rewritten to hand the repo configuration via environment variables

I have a server setup in which each repo has a trac instance and
for the commit filter I really need to know with which repo I'm
dealing in order to be able to resolve the #123 ticket numbers
into hyperlinks into the correct trac instance.

Lars, patch 3 has become quite a bit more complex. However, adding
      environment variables is a matter of simply extending the
      env_vars array in the prepare_env function; only the code
      that processes that array has become a bit more complex.

Ferry Huberts (5):
  new_filter: determine extra_args from filter type
  cgit_open_filter: also take the repo as a parameter
  cgit_open_filter: hand down repo configuration to script
  filters: document environment variables in filter scripts
  debug logging

 cgit.c                         |   27 +++++++--
(Continue reading)

Ferry Huberts | 23 Mar 2011 15:03
Gravatar

[PATCH v4 3/4] cgit_open_filter: hand down repo configuration to script

From: Ferry Huberts <ferry.huberts@...>

The environment variables can be used to (for example) resolve
the following situation:

Suppose a server setup in which each repository has a trac
instance; the commit filter needs to know with which
repository it's dealing in order to be able to resolve the
#123 ticket numbers in the commit messages into hyperlinks
into the correct trac instance.

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 shared.c |   78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 77 insertions(+), 1 deletions(-)

diff --git a/shared.c b/shared.c
index e4879df..8c3d18a 100644
--- a/shared.c
+++ b/shared.c
 <at>  <at>  -7,6 +7,8  <at>  <at> 
  */

 #include "cgit.h"
+#include <stdio.h>
+#include <linux/limits.h>

 struct cgit_repolist cgit_repolist;
 struct cgit_context ctx;
 <at>  <at>  -376,6 +378,70  <at>  <at>  int cgit_parse_snapshots_mask(const char *str)
(Continue reading)

Ferry Huberts | 23 Mar 2011 15:03
Gravatar

[PATCH v4 1/4] new_filter: determine extra_args from filter type

From: Ferry Huberts <ferry.huberts@...>

Currently the number of extra arguments is linked hard to the type of
the filter. This is also logical since it would be confusing to have
a different number of arguments for the same type of filter depending
on the context under which the filter is run (unless ofcourse one the
parameters would make the context clear, which is currently not the
case).

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgit.c |   27 ++++++++++++++++++++-------
 cgit.h |    4 ++++
 2 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/cgit.c b/cgit.c
index f4dd6ef..5d6e488 100644
--- a/cgit.c
+++ b/cgit.c
 <at>  <at>  -26,13 +26,26  <at>  <at>  void add_mimetype(const char *name, const char *value)
 	item->util = xstrdup(value);
 }

-struct cgit_filter *new_filter(const char *cmd, int extra_args)
+struct cgit_filter *new_filter(const char *cmd, filter_type filtertype)
 {
 	struct cgit_filter *f;
+	int extra_args;

 	if (!cmd || !cmd[0])
(Continue reading)

Ferry Huberts | 23 Mar 2011 15:03
Gravatar

[PATCH v4 4/4] filters: document environment variables in filter scripts

From: Ferry Huberts <ferry.huberts@...>

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgitrc.5.txt                   |   47 +++++++++++++++++++++++++++++++++++----
 filters/commit-links.sh        |   11 +++++++++
 filters/syntax-highlighting.sh |   11 +++++++++
 3 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index c3698a6..60539d7 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
 <at>  <at>  -31,7 +31,7  <at>  <at>  about-filter::
 	about pages (both top-level and for each repository). The command will
 	get the content of the about-file on its STDIN, and the STDOUT from the
 	command will be included verbatim on the about page. Default value:
-	none.
+	none. See also: "FILTER API".

 agefile::
 	Specifies a path, relative to each repository path, which can be used
 <at>  <at>  -81,6 +81,7  <at>  <at>  commit-filter::
 	The command will get the message on its STDIN, and the STDOUT from the
 	command will be included verbatim as the commit message, i.e. this can
 	be used to implement bugtracker integration. Default value: none.
+	See also: "FILTER API".

 css::
 	Url which specifies the css document to include in all cgit pages.
(Continue reading)

Ferry Huberts | 23 Mar 2011 15:03
Gravatar

[PATCH v4 2/4] cgit_open_filter: also take the repo as a parameter

From: Ferry Huberts <ferry.huberts@...>

To prepare for handing repo configuration to the
filter script that is executed.

Signed-off-by: Ferry Huberts <ferry.huberts@...>
---
 cgit.h        |    2 +-
 shared.c      |    2 +-
 ui-commit.c   |    6 +++---
 ui-repolist.c |    2 +-
 ui-snapshot.c |    2 +-
 ui-summary.c  |    2 +-
 ui-tree.c     |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/cgit.h b/cgit.h
index 1f8b1be..3b0eaf5 100644
--- a/cgit.h
+++ b/cgit.h
 <at>  <at>  -318,7 +318,7  <at>  <at>  extern const char *cgit_repobasename(const char *reponame);

 extern int cgit_parse_snapshots_mask(const char *str);

-extern int cgit_open_filter(struct cgit_filter *filter);
+extern int cgit_open_filter(struct cgit_filter *filter, struct cgit_repo * repo);
 extern int cgit_close_filter(struct cgit_filter *filter);

 extern int readfile(const char *path, char **buf, size_t *size);
diff --git a/shared.c b/shared.c
(Continue reading)


Gmane