threads / patch / 60329

patch[OUTREACHY] Fixed add.c file to conform to guidelines when using die() listed in issue #635

Subject: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using die() listed in issue #635

## tl;dr

4 messages between Oct 9, 2023 and Oct 9, 2023. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Naomi Ibe· Oct 9, 2023, 01:16 UTC · lore
From: Naomi <naomi.ibeh69@gmail.com>
Signed-off-by: Naomi Ibe <naomi.ibeh69@gmail.com>
---
 builtin/add.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Show changes to builtin/add.c +5 −5
diff --git a/builtin/add.c b/builtin/add.c
index c27254a5cd..5126d2ede3 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -182,7 +182,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 	git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
 
 	if (repo_read_index(the_repository) < 0)
-		die(_("Could not read the index"));
+		die(_("could not read the index"));
 
 	repo_init_revisions(the_repository, &rev, prefix);
 	rev.diffopt.context = 7;
@@ -200,15 +200,15 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
 		die(_("editing patch failed"));
 
 	if (stat(file, &st))
-		die_errno(_("Could not stat '%s'"), file);
+		die_errno(_("could not stat '%s'"), file);
 	if (!st.st_size)
-		die(_("Empty patch. Aborted."));
+		die(_("empty patch. aborted"));
 
 	child.git_cmd = 1;
 	strvec_pushl(&child.args, "apply", "--recount", "--cached", file,
 		     NULL);
 	if (run_command(&child))
-		die(_("Could not apply '%s'"), file);
+		die(_("could not apply '%s'"), file);
 
 	unlink(file);
 	free(file);
@@ -568,7 +568,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
 finish:
 	if (write_locked_index(&the_index, &lock_file,
 			       COMMIT_LOCK | SKIP_IF_UNCHANGED))
-		die(_("Unable to write new index file"));
+		die(_("unable to write new index file"));
 
 	dir_clear(&dir);
 	clear_pathspec(&pathspec);
-- 
2.36.1.windows.1
Christian Couder· Oct 9, 2023, 07:27 UTC · re: Naomi Ibe · lore

Re: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using die() listed in issue #635

On Mon, Oct 9, 2023 at 3:17 AM Naomi Ibe <naomi.ibeh69@gmail.com> wrote:
>
> From: Naomi <naomi.ibeh69@gmail.com>

First the subject should start, after "[PATCH 1/1][Outreachy]", with the area of the code you are changing followed by ":", so here "add:" (no need for ".c").

Also even if the subject gives a lot of information already, it's better to use the body of the commit message to give a bit more context and details. For example here either the subject or the body of the commit message should say which specific guideline(s) the patch is enforcing.

Show 5 quoted lines
> Signed-off-by: Naomi Ibe <naomi.ibeh69@gmail.com>
> ---
>  builtin/add.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
Otherwise the patch looks good to me.
Thanks!
Naomi Ibe· Oct 9, 2023, 07:57 UTC · re: Christian Couder · lore

Re: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using die() listed in issue #635

Thank you very much for the feedback Christian, I'd definitely keep this in mind the next time I'm creating/sending a patch. You also said asides working on my commit message, the patch looks good, but as I'm applying to Outreachy, I need to send in my proof of contribution as a link of a task I worked on. Would sending a link of the mailing list , with the url of this patch I just worked on suffice?Something like this : https://public-inbox.org/git/20231009011652.1791-1-naomi.ibeh69@gmail.com/T/#u I ask because since I used patches to send to Git , I have no pull request link to submit.

On Mon, Oct 9, 2023 at 8:28 AM Christian Couder <christian.couder@gmail.com> wrote:

Show 24 quoted lines
>
> On Mon, Oct 9, 2023 at 3:17 AM Naomi Ibe <naomi.ibeh69@gmail.com> wrote:
> >
> > From: Naomi <naomi.ibeh69@gmail.com>
>
> First the subject should start, after "[PATCH 1/1][Outreachy]", with
> the area of the code you are changing followed by ":", so here "add:"
> (no need for ".c").
>
> Also even if the subject gives a lot of information already, it's
> better to use the body of the commit message to give a bit more
> context and details. For example here either the subject or the body
> of the commit message should say which specific guideline(s) the patch
> is enforcing.
>
> > Signed-off-by: Naomi Ibe <naomi.ibeh69@gmail.com>
> > ---
> >  builtin/add.c | 10 +++++-----
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> >
>
> Otherwise the patch looks good to me.
>
> Thanks!
Christian Couder· Oct 9, 2023, 08:22 UTC · re: Naomi Ibe · lore

Re: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using die() listed in issue #635

On Mon, Oct 9, 2023 at 9:57 AM Naomi Ibe <naomi.ibeh69@gmail.com> wrote:
>
> Thank you very much for the feedback Christian, I'd definitely keep
> this in mind the next time I'm creating/sending a patch.
Great!
> You also said asides working on my commit message, the patch looks
> good,

Yeah, but first others might find some issues in the patch itself, also, as I say elsewhere, I think it's worth it for you to send a version 2 of the patch that fixes the commit message issues I pointed out.

Show 7 quoted lines
> but as I'm applying to Outreachy, I need to send in my proof of
> contribution as a link of a task I worked on.
> Would sending a link of the mailing list , with the url of this patch
> I just worked on suffice?Something like this :
> https://public-inbox.org/git/20231009011652.1791-1-naomi.ibeh69@gmail.com/T/#u
> I ask because since I used patches to send to Git , I have no pull
> request link to submit.

Yeah, links to the emails you sent in a mailing list archive (Public Inbox or lore.kernel.org/git) are fine.

← back to recent threads