git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson
@ 2025-05-29 19:20 Lucas Seiki Oshiro
  2025-05-29 19:20 ` [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-05-29 19:20 UTC (permalink / raw)
  To: git; +Cc: Lucas Seiki Oshiro

Hi!

I was studying for GSoC using this documentation, but I found out that two
things were outdated:

1. The lack of using the `struct repository *repo*` parameter in some functions;
2. There were a instruction for adding the new command to the Makefile, but
there are no mentions to Meson.

This patchset updates this documentation file, and hopefully will help future
new contributors.

Lucas Seiki Oshiro (2):
  MyFirstContribution: use struct repository in examples
  MyFirstContribution: add walken.c to meson.build

 Documentation/MyFirstObjectWalk.adoc | 27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

-- 
2.39.5 (Apple Git-154)


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

* [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples
  2025-05-29 19:20 [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Lucas Seiki Oshiro
@ 2025-05-29 19:20 ` Lucas Seiki Oshiro
  2025-05-29 19:57   ` Karthik Nayak
  2025-05-29 19:20 ` [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-05-29 19:20 UTC (permalink / raw)
  To: git; +Cc: Lucas Seiki Oshiro

Add the parameter `struct repository *repo` to the cmd_walken function.

Since commit 9b1cb50, all the cmd_* have the `repo` parameter and new
commands must follow this convention, so the documentation should also
be changed.

Also change the `git_config` calls to `repo_config`, also passing the
`repo` parameter.

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
---
 Documentation/MyFirstObjectWalk.adoc | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
index f03753dfc0..29d26abb47 100644
--- a/Documentation/MyFirstObjectWalk.adoc
+++ b/Documentation/MyFirstObjectWalk.adoc
@@ -43,7 +43,7 @@ Open up a new file `builtin/walken.c` and set up the command handler:
 #include "builtin.h"
 #include "trace.h"
 
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	trace_printf(_("cmd_walken incoming...\n"));
 	return 0;
@@ -86,7 +86,7 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
 Also add the relevant line in `builtin.h` near `cmd_version()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix);
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo);
 ----
 
 Include the command in `git.c` in `commands[]` near the entry for `version`,
@@ -193,7 +193,7 @@ initialization functions.
 
 Next, we should have a look at any relevant configuration settings (i.e.,
 settings readable and settable from `git config`). This is done by providing a
-callback to `git_config()`; within that callback, you can also invoke methods
+callback to `repo_config()`; within that callback, you can also invoke methods
 from other components you may need that need to intercept these options. Your
 callback will be invoked once per each configuration value which Git knows about
 (global, local, worktree, etc.).
@@ -221,14 +221,14 @@ static int git_walken_config(const char *var, const char *value,
 }
 ----
 
-Make sure to invoke `git_config()` with it in your `cmd_walken()`:
+Make sure to invoke `repo_config()` with it in your `cmd_walken()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	...
 
-	git_config(git_walken_config, NULL);
+	repo_config(repo, git_walken_config, NULL);
 
 	...
 }
@@ -250,14 +250,14 @@ We'll also need to include the `revision.h` header:
 
 ...
 
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	/* This can go wherever you like in your declarations.*/
 	struct rev_info rev;
 	...
 
 	/* This should go after the git_config() call. */
-	repo_init_revisions(the_repository, &rev, prefix);
+	repo_init_revisions(repo, the_repository, &rev, prefix);
 
 	...
 }
@@ -305,7 +305,7 @@ Then let's invoke `final_rev_info_setup()` after the call to
 `repo_init_revisions()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	...
 
-- 
2.39.5 (Apple Git-154)


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

* [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build
  2025-05-29 19:20 [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Lucas Seiki Oshiro
  2025-05-29 19:20 ` [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
@ 2025-05-29 19:20 ` Lucas Seiki Oshiro
  2025-05-29 20:02   ` Karthik Nayak
  2025-05-30  8:00   ` Patrick Steinhardt
  2025-05-29 20:06 ` [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Karthik Nayak
  2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
  3 siblings, 2 replies; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-05-29 19:20 UTC (permalink / raw)
  To: git; +Cc: Lucas Seiki Oshiro

Instruct in the documentation to also add an entry in meson.build for
builtin/walken.c, as currently both Meson and Make are supported.

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
---
 Documentation/MyFirstObjectWalk.adoc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
index 29d26abb47..3b66e48dd9 100644
--- a/Documentation/MyFirstObjectWalk.adoc
+++ b/Documentation/MyFirstObjectWalk.adoc
@@ -96,12 +96,19 @@ maintaining alphabetical ordering:
 { "walken", cmd_walken, RUN_SETUP },
 ----
 
-Add it to the `Makefile` near the line for `builtin/worktree.o`:
+Add an entry for the new command in the file of our two build systems (Make
+and Meson) before the entry for `worktree`:
 
+- In the `Makefile`:
 ----
 BUILTIN_OBJS += builtin/walken.o
 ----
 
+- In the `meson.build` file:
+----
+  'builtin/walken.c',
+----
+
 Build and test out your command, without forgetting to ensure the `DEVELOPER`
 flag is set, and with `GIT_TRACE` enabled so the debug output can be seen:
 
-- 
2.39.5 (Apple Git-154)


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

* Re: [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples
  2025-05-29 19:20 ` [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
@ 2025-05-29 19:57   ` Karthik Nayak
  0 siblings, 0 replies; 11+ messages in thread
From: Karthik Nayak @ 2025-05-29 19:57 UTC (permalink / raw)
  To: Lucas Seiki Oshiro, git

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

Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:

> Add the parameter `struct repository *repo` to the cmd_walken function.
>
> Since commit 9b1cb50, all the cmd_* have the `repo` parameter and new

When referencing commits, we stick to a particular format. From
'Documentation/SubmittingPatches', we have:

  When you reference a commit on a more stable branch (like `master`,
  `maint` and `next`), use the format "abbreviated hash (subject,
  date)", like this:

  ....
  	Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
  	noticed that ...
  ....

The document also states that `git show -s --pretty=reference <commit>`
can be used to obtain this format.

> commands must follow this convention, so the documentation should also
> be changed.
>
> Also change the `git_config` calls to `repo_config`, also passing the
> `repo` parameter.

Nit: Okay this makes sense, but It would be nice, if you also elaborate
a bit here, about why you want to make that change. The context being
that since 036876a106 (config: hide functions using `the_repository` by
default, 2024-08-13) the non-repo config functions are no longer
recommended as they use the global 'repository' variable.

>
> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
> ---
>  Documentation/MyFirstObjectWalk.adoc | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
>
> diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
> index f03753dfc0..29d26abb47 100644
> --- a/Documentation/MyFirstObjectWalk.adoc
> +++ b/Documentation/MyFirstObjectWalk.adoc
> @@ -43,7 +43,7 @@ Open up a new file `builtin/walken.c` and set up the command handler:
>  #include "builtin.h"
>  #include "trace.h"
>
> -int cmd_walken(int argc, const char **argv, const char *prefix)
> +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
>  {
>  	trace_printf(_("cmd_walken incoming...\n"));
>  	return 0;
> @@ -86,7 +86,7 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
>  Also add the relevant line in `builtin.h` near `cmd_version()`:
>
>  ----
> -int cmd_walken(int argc, const char **argv, const char *prefix);
> +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo);
>  ----
>
>  Include the command in `git.c` in `commands[]` near the entry for `version`,
> @@ -193,7 +193,7 @@ initialization functions.
>
>  Next, we should have a look at any relevant configuration settings (i.e.,
>  settings readable and settable from `git config`). This is done by providing a
> -callback to `git_config()`; within that callback, you can also invoke methods
> +callback to `repo_config()`; within that callback, you can also invoke methods
>  from other components you may need that need to intercept these options. Your
>  callback will be invoked once per each configuration value which Git knows about
>  (global, local, worktree, etc.).
> @@ -221,14 +221,14 @@ static int git_walken_config(const char *var, const char *value,
>  }
>  ----
>
> -Make sure to invoke `git_config()` with it in your `cmd_walken()`:
> +Make sure to invoke `repo_config()` with it in your `cmd_walken()`:
>
>  ----
> -int cmd_walken(int argc, const char **argv, const char *prefix)
> +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
>  {
>  	...
>
> -	git_config(git_walken_config, NULL);
> +	repo_config(repo, git_walken_config, NULL);
>
>  	...
>  }
> @@ -250,14 +250,14 @@ We'll also need to include the `revision.h` header:
>
>  ...
>
> -int cmd_walken(int argc, const char **argv, const char *prefix)
> +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
>  {
>  	/* This can go wherever you like in your declarations.*/
>  	struct rev_info rev;
>  	...
>
>  	/* This should go after the git_config() call. */

Shouldn't this be s/git_config/repo_config ?

> -	repo_init_revisions(the_repository, &rev, prefix);
> +	repo_init_revisions(repo, the_repository, &rev, prefix);
>
>  	...
>  }
> @@ -305,7 +305,7 @@ Then let's invoke `final_rev_info_setup()` after the call to
>  `repo_init_revisions()`:
>
>  ----
> -int cmd_walken(int argc, const char **argv, const char *prefix)
> +int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
>  {
>  	...
>
> --
> 2.39.5 (Apple Git-154)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* Re: [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build
  2025-05-29 19:20 ` [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
@ 2025-05-29 20:02   ` Karthik Nayak
  2025-05-30  8:00   ` Patrick Steinhardt
  1 sibling, 0 replies; 11+ messages in thread
From: Karthik Nayak @ 2025-05-29 20:02 UTC (permalink / raw)
  To: Lucas Seiki Oshiro, git

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

Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:

> Instruct in the documentation to also add an entry in meson.build for
> builtin/walken.c, as currently both Meson and Make are supported.
>

Nice.

> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
> ---
>  Documentation/MyFirstObjectWalk.adoc | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
> index 29d26abb47..3b66e48dd9 100644
> --- a/Documentation/MyFirstObjectWalk.adoc
> +++ b/Documentation/MyFirstObjectWalk.adoc
> @@ -96,12 +96,19 @@ maintaining alphabetical ordering:
>  { "walken", cmd_walken, RUN_SETUP },
>  ----
>
> -Add it to the `Makefile` near the line for `builtin/worktree.o`:
> +Add an entry for the new command in the file of our two build systems (Make
> +and Meson) before the entry for `worktree`:
>

Super nit: The 'our two build systems' is a bit out of context, which is
why you also mention them in parenthesis. Perhaps we can simply name
them directly. Perhaps something like:

  Add an entry for the new command in both the Make and Meson build
  systems, before the entry for `worktree`:

Feel free to ignore this :)

> +- In the `Makefile`:
>  ----
>  BUILTIN_OBJS += builtin/walken.o
>  ----
>
> +- In the `meson.build` file:
> +----
> +  'builtin/walken.c',
> +----
> +
>  Build and test out your command, without forgetting to ensure the `DEVELOPER`
>  flag is set, and with `GIT_TRACE` enabled so the debug output can be seen:
>
> --
> 2.39.5 (Apple Git-154)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* Re: [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson
  2025-05-29 19:20 [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Lucas Seiki Oshiro
  2025-05-29 19:20 ` [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
  2025-05-29 19:20 ` [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
@ 2025-05-29 20:06 ` Karthik Nayak
  2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
  3 siblings, 0 replies; 11+ messages in thread
From: Karthik Nayak @ 2025-05-29 20:06 UTC (permalink / raw)
  To: Lucas Seiki Oshiro, git

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

Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:

> Hi!
>
> I was studying for GSoC using this documentation, but I found out that two
> things were outdated:
>
> 1. The lack of using the `struct repository *repo*` parameter in some functions;
> 2. There were a instruction for adding the new command to the Makefile, but
> there are no mentions to Meson.
>
> This patchset updates this documentation file, and hopefully will help future
> new contributors.
>

Thanks for this. These documents are often missed by regular
contributors since they don't refer to them as much as newcomers. So
good to see that it is being updated.

I've left some small comments, but overall this looks good.

> Lucas Seiki Oshiro (2):
>   MyFirstContribution: use struct repository in examples
>   MyFirstContribution: add walken.c to meson.build
>
>  Documentation/MyFirstObjectWalk.adoc | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
>
> --
> 2.39.5 (Apple Git-154)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 690 bytes --]

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

* Re: [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build
  2025-05-29 19:20 ` [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
  2025-05-29 20:02   ` Karthik Nayak
@ 2025-05-30  8:00   ` Patrick Steinhardt
  1 sibling, 0 replies; 11+ messages in thread
From: Patrick Steinhardt @ 2025-05-30  8:00 UTC (permalink / raw)
  To: Lucas Seiki Oshiro; +Cc: git

On Thu, May 29, 2025 at 04:20:36PM -0300, Lucas Seiki Oshiro wrote:
> diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
> index 29d26abb47..3b66e48dd9 100644
> --- a/Documentation/MyFirstObjectWalk.adoc
> +++ b/Documentation/MyFirstObjectWalk.adoc
> @@ -96,12 +96,19 @@ maintaining alphabetical ordering:
>  { "walken", cmd_walken, RUN_SETUP },
>  ----
>  
> -Add it to the `Makefile` near the line for `builtin/worktree.o`:
> +Add an entry for the new command in the file of our two build systems (Make
> +and Meson) before the entry for `worktree`:
>  
> +- In the `Makefile`:
>  ----
>  BUILTIN_OBJS += builtin/walken.o
>  ----
>  
> +- In the `meson.build` file:
> +----
> +  'builtin/walken.c',
> +----

It's a bit hard for the reader to know _where_ to add this. How about we
say this instead:

    ----
    builtin_sources = [
      ...
     'builtin/walken.c',
      ...
    ]
    ----

That should make it was easier to figure out.

Patrick

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

* [GSoC PATCH v2 0/2] MyFirstObjectWalk: update with struct repository and meson
  2025-05-29 19:20 [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Lucas Seiki Oshiro
                   ` (2 preceding siblings ...)
  2025-05-29 20:06 ` [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Karthik Nayak
@ 2025-06-02 20:50 ` Lucas Seiki Oshiro
  2025-06-02 20:50   ` [GSoC PATCH v2 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
                     ` (2 more replies)
  3 siblings, 3 replies; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-06-02 20:50 UTC (permalink / raw)
  To: git; +Cc: ps, karthik.188, Lucas Seiki Oshiro

Hi!

This v2:

- Applies the suggestions from Karthik to the commit messages and the
  documentation content;

- Makes it more clear where to place the new Meson, as pointed by Patrick.

Thanks!

Lucas Seiki Oshiro (2):
  MyFirstContribution: use struct repository in examples
  MyFirstContribution: add walken.c to meson.build

 Documentation/MyFirstObjectWalk.adoc | 35 +++++++++++++++++++---------
 1 file changed, 24 insertions(+), 11 deletions(-)

-- 
2.39.5 (Apple Git-154)


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

* [GSoC PATCH v2 1/2] MyFirstContribution: use struct repository in examples
  2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
@ 2025-06-02 20:50   ` Lucas Seiki Oshiro
  2025-06-02 20:50   ` [GSoC PATCH v2 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
  2025-06-03  6:08   ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update with struct repository and meson Patrick Steinhardt
  2 siblings, 0 replies; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-06-02 20:50 UTC (permalink / raw)
  To: git; +Cc: ps, karthik.188, Lucas Seiki Oshiro

Add the parameter `struct repository *repo` to the cmd_walken function.

Since commit 9b1cb5070f (builtin: add a repository parameter for
builtin functions, 2024-09-13), all the cmd_* have the `repo` parameter
and new commands must follow this convention, so the documentation
should also be changed.

Change the `git_config` calls to `repo_config`, also passing the `repo`
parameter, as since 036876a106 (config: hide functions using
`the_repository` by default, 2024-08-13) the non-repo config functions
are no longer recommended as they use the global `repository` variable.

Helped-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
---
 Documentation/MyFirstObjectWalk.adoc | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
index f03753dfc0..a4ba6e21ec 100644
--- a/Documentation/MyFirstObjectWalk.adoc
+++ b/Documentation/MyFirstObjectWalk.adoc
@@ -43,7 +43,7 @@ Open up a new file `builtin/walken.c` and set up the command handler:
 #include "builtin.h"
 #include "trace.h"
 
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	trace_printf(_("cmd_walken incoming...\n"));
 	return 0;
@@ -86,7 +86,7 @@ int cmd_walken(int argc, const char **argv, const char *prefix)
 Also add the relevant line in `builtin.h` near `cmd_version()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix);
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo);
 ----
 
 Include the command in `git.c` in `commands[]` near the entry for `version`,
@@ -193,7 +193,7 @@ initialization functions.
 
 Next, we should have a look at any relevant configuration settings (i.e.,
 settings readable and settable from `git config`). This is done by providing a
-callback to `git_config()`; within that callback, you can also invoke methods
+callback to `repo_config()`; within that callback, you can also invoke methods
 from other components you may need that need to intercept these options. Your
 callback will be invoked once per each configuration value which Git knows about
 (global, local, worktree, etc.).
@@ -221,14 +221,14 @@ static int git_walken_config(const char *var, const char *value,
 }
 ----
 
-Make sure to invoke `git_config()` with it in your `cmd_walken()`:
+Make sure to invoke `repo_config()` with it in your `cmd_walken()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	...
 
-	git_config(git_walken_config, NULL);
+	repo_config(repo, git_walken_config, NULL);
 
 	...
 }
@@ -250,14 +250,14 @@ We'll also need to include the `revision.h` header:
 
 ...
 
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	/* This can go wherever you like in your declarations.*/
 	struct rev_info rev;
 	...
 
-	/* This should go after the git_config() call. */
-	repo_init_revisions(the_repository, &rev, prefix);
+	/* This should go after the repo_config() call. */
+	repo_init_revisions(repo, &rev, prefix);
 
 	...
 }
@@ -305,7 +305,7 @@ Then let's invoke `final_rev_info_setup()` after the call to
 `repo_init_revisions()`:
 
 ----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
 {
 	...
 
-- 
2.39.5 (Apple Git-154)


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

* [GSoC PATCH v2 2/2] MyFirstContribution: add walken.c to meson.build
  2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
  2025-06-02 20:50   ` [GSoC PATCH v2 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
@ 2025-06-02 20:50   ` Lucas Seiki Oshiro
  2025-06-03  6:08   ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update with struct repository and meson Patrick Steinhardt
  2 siblings, 0 replies; 11+ messages in thread
From: Lucas Seiki Oshiro @ 2025-06-02 20:50 UTC (permalink / raw)
  To: git; +Cc: ps, karthik.188, Lucas Seiki Oshiro

Instruct in the documentation to also add an entry in meson.build for
builtin/walken.c, as currently both Meson and Make are supported.

Helped-by: Karthik Nayak <karthik.188@gmail.com>
Helped-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
---
 Documentation/MyFirstObjectWalk.adoc | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/MyFirstObjectWalk.adoc b/Documentation/MyFirstObjectWalk.adoc
index a4ba6e21ec..413a9fdb05 100644
--- a/Documentation/MyFirstObjectWalk.adoc
+++ b/Documentation/MyFirstObjectWalk.adoc
@@ -96,10 +96,23 @@ maintaining alphabetical ordering:
 { "walken", cmd_walken, RUN_SETUP },
 ----
 
-Add it to the `Makefile` near the line for `builtin/worktree.o`:
+Add an entry for the new command in the both the Make and Meson build system,
+before the entry for `worktree`:
 
+- In the `Makefile`:
 ----
+...
 BUILTIN_OBJS += builtin/walken.o
+...
+----
+
+- In the `meson.build` file:
+----
+builtin_sources = [
+   ...
+  'builtin/walken.c',
+   ...
+]
 ----
 
 Build and test out your command, without forgetting to ensure the `DEVELOPER`
-- 
2.39.5 (Apple Git-154)


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

* Re: [GSoC PATCH v2 0/2] MyFirstObjectWalk: update with struct repository and meson
  2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
  2025-06-02 20:50   ` [GSoC PATCH v2 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
  2025-06-02 20:50   ` [GSoC PATCH v2 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
@ 2025-06-03  6:08   ` Patrick Steinhardt
  2 siblings, 0 replies; 11+ messages in thread
From: Patrick Steinhardt @ 2025-06-03  6:08 UTC (permalink / raw)
  To: Lucas Seiki Oshiro; +Cc: git, karthik.188

On Mon, Jun 02, 2025 at 05:50:19PM -0300, Lucas Seiki Oshiro wrote:
> Hi!
> 
> This v2:
> 
> - Applies the suggestions from Karthik to the commit messages and the
>   documentation content;
> 
> - Makes it more clear where to place the new Meson, as pointed by Patrick.
> 
> Thanks!

It would be great if you could include the range-diff for future patch
series. You can either generate it via git-format-patch(1), or use a
tool like b4 that automates a lot of this for you. This would help
reviewers to see what exactly has changed.

In any case, this version looks good to me. Thanks!

Patrick

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

end of thread, other threads:[~2025-06-03  6:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 19:20 [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Lucas Seiki Oshiro
2025-05-29 19:20 ` [GSoC PATCH 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
2025-05-29 19:57   ` Karthik Nayak
2025-05-29 19:20 ` [GSoC PATCH 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
2025-05-29 20:02   ` Karthik Nayak
2025-05-30  8:00   ` Patrick Steinhardt
2025-05-29 20:06 ` [GSoC PATCH 0/2] Update MyFirstObjectWalk with struct repository and meson Karthik Nayak
2025-06-02 20:50 ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update " Lucas Seiki Oshiro
2025-06-02 20:50   ` [GSoC PATCH v2 1/2] MyFirstContribution: use struct repository in examples Lucas Seiki Oshiro
2025-06-02 20:50   ` [GSoC PATCH v2 2/2] MyFirstContribution: add walken.c to meson.build Lucas Seiki Oshiro
2025-06-03  6:08   ` [GSoC PATCH v2 0/2] MyFirstObjectWalk: update with struct repository and meson Patrick Steinhardt

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 NNTP newsgroup(s).