Skip to contentSkip to conversation

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

PATCH In review Naomi Ibe 2 participants 4 messages Oct 9, 2023

lore
Share & tools
lore

Naomi Ibe

author
#0 lore raw

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

From: Naomi <[email protected]>

---
 builtin/add.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
builtin/add.c +5 -5
index c27254a5cd..5126d2ede3 100644
@@ -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);
Signature · 1 line
2.36.1.windows.1
#1 lore raw
Quoted 2 lines · Naomi Ibe

From: Naomi <[email protected]>

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.

Quoted 5 lines
---
 builtin/add.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Otherwise the patch looks good to me.

Thanks!

author
#2 lore raw

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/[email protected]/T/#u
I ask because since I used patches to send to Git , I have no pull request link to submit.

Quoted 24 lines · Christian Couder
Quoted 2 lines · Naomi Ibe

From: Naomi <[email protected]>

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.

Quoted 5 lines
---
 builtin/add.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Otherwise the patch looks good to me.

Thanks!

#3 lore raw
Quoted 3 lines · Naomi Ibe

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!

Quoted 2 lines

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.

Quoted 7 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/[email protected]/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.