Skip to contentSkip to conversation

Include gettext.h in MyFirstContribution tutorial

PATCH In review Jacob Stopak 3 participants 3 messages Oct 17, 2023 – Oct 26, 2023 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Include gettext.h in MyFirstContribution tutorial

The tutorial in Documentation/MyFirstContribution.txt has steps to print some text using the "_" function. However, this leads to compiler errors when running "make" since "gettext.h" is not #included.

Update docs with a note to #include "gettext.h" in "builtin/psuh.c".

---
 Documentation/MyFirstContribution.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Documentation/MyFirstContribution.txt +4 -3
index 62d11a5cd7..7cfed60c2e 100644
@@ -160,10 +160,11 @@ in order to keep the declarations alphabetically sorted:
 int cmd_psuh(int argc, const char **argv, const char *prefix);
 ----
 
-Be sure to `#include "builtin.h"` in your `psuh.c`.
+Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
+`#include "gettext.h"` to use functions related to printing output text.
 
-Go ahead and add some throwaway printf to that function. This is a decent
-starting point as we can now add build rules and register the command.
+Go ahead and add some throwaway printf to the `cmd_psuh` function. This is a
+decent starting point as we can now add build rules and register the command.
 
 NOTE: Your throwaway text, as well as much of the text you will be adding over
 the course of this tutorial, is user-facing. That means it needs to be
Signature · 1 line
2.42.0.398.ga9ecda2788.dirty
#1 lore raw
Quoted 10 lines · Jacob Stopak

The tutorial in Documentation/MyFirstContribution.txt has steps to print some text using the "_" function. However, this leads to compiler errors when running "make" since "gettext.h" is not #included.

Update docs with a note to #include "gettext.h" in "builtin/psuh.c".

---
 Documentation/MyFirstContribution.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Who's the first responder on this document these days? I think the "psuh" was Emily's invention, so sending it in her direction.

Thanks.

Quoted 19 lines
Documentation/MyFirstContribution.txt +4 -3
index 62d11a5cd7..7cfed60c2e 100644
@@ -160,10 +160,11 @@ in order to keep the declarations alphabetically sorted:
 int cmd_psuh(int argc, const char **argv, const char *prefix);
 ----
 
-Be sure to `#include "builtin.h"` in your `psuh.c`.
+Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
+`#include "gettext.h"` to use functions related to printing output text.
 
-Go ahead and add some throwaway printf to that function. This is a decent
-starting point as we can now add build rules and register the command.
+Go ahead and add some throwaway printf to the `cmd_psuh` function. This is a
+decent starting point as we can now add build rules and register the command.
 
 NOTE: Your throwaway text, as well as much of the text you will be adding over
 the course of this tutorial, is user-facing. That means it needs to be
Reviewed-by
#2 lore raw
Quoted 14 lines · Junio C Hamano
Quoted 10 lines · Jacob Stopak

The tutorial in Documentation/MyFirstContribution.txt has steps to print some text using the "_" function. However, this leads to compiler errors when running "make" since "gettext.h" is not #included.

Update docs with a note to #include "gettext.h" in "builtin/psuh.c".

---
 Documentation/MyFirstContribution.txt | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Quoted 4 lines

Who's the first responder on this document these days? I think the "psuh" was Emily's invention, so sending it in her direction.

Thanks.

Thanks for the nudge and sorry for the slow response (and thanks to Jack for pointing out to me that I was delinquent).

I like this change. Nice touch disambiguating "function" in the following paragraph.

Quoted 20 lines
Quoted 20 lines
Documentation/MyFirstContribution.txt +4 -3
index 62d11a5cd7..7cfed60c2e 100644
@@ -160,10 +160,11 @@ in order to keep the declarations alphabetically sorted:
 int cmd_psuh(int argc, const char **argv, const char *prefix);
 ----
 
-Be sure to `#include "builtin.h"` in your `psuh.c`.
+Be sure to `#include "builtin.h"` in your `psuh.c`. You'll also need to
+`#include "gettext.h"` to use functions related to printing output text.
 
-Go ahead and add some throwaway printf to that function. This is a decent
-starting point as we can now add build rules and register the command.
+Go ahead and add some throwaway printf to the `cmd_psuh` function. This is a
+decent starting point as we can now add build rules and register the command.
 
 NOTE: Your throwaway text, as well as much of the text you will be adding over
 the course of this tutorial, is user-facing. That means it needs to be