diff mbox series

[2/4] Docs: Correct cmd_psuh and Explain UNUSED macro

Message ID 20250416061450.25695-3-jayatheerthkulkarni2005@gmail.com (mailing list archive)
State New
Headers show
Series update MyFirstContribution with current code base | expand

Commit Message

K Jayatheerth April 16, 2025, 6:14 a.m. UTC
The `cmd_psuh` function signature in the documentation,
was missing the `struct repository *repo` argument,
which is standard for built-in commands.
This commit corrects the signature to include the `repo` argument.

Additionally, this commit adds an explanation,
for using the `UNUSED` macro to prevent compiler warnings.

This helps new contributors understand,
common practices in the Git codebase.

Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
---
 Documentation/MyFirstContribution.adoc | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc
index ef190d8748..b463d42f63 100644
--- a/Documentation/MyFirstContribution.adoc
+++ b/Documentation/MyFirstContribution.adoc
@@ -142,7 +142,15 @@  command in `builtin/psuh.c`. Create that file, and within it, write the entry
 point for your command in a function matching the style and signature:
 
 ----
-int cmd_psuh(int argc, const char **argv, const char *prefix)
+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)
+----
+
+We also use the UNUSED macro to make sure we don't recieve compiler warnings
+for unused arguments from the function cmd_psuh.
+
+----
+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, 
+			const char *prefix UNUSED, struct repository *repo UNUSED)
 ----
 
 We'll also need to add the declaration of psuh; open up `builtin.h`, find the