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 4 participants 7 messages Oct 9, 2023 – Oct 11, 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 1 line · Naomi Ibe

Subject: Re: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using d

Subject: [OUTREACHY][PATCH 1/1] builtin/add.c: clean up die() messages

Quoted 1 line

From: Naomi <[email protected]>

The name and address on this line come from your commit object, which in turn would have came from your configuration. You have

[user]
name = Naomi
email = [email protected]

somewhere in your configuration file, perhaps in $HOME/.gitconfig or somewhere. When contributiong to this project, you want that "name" line to also include your family name, as it should match what you write on your Signed-off-by: line. A focused way to do so without affecting your author identity for other projects is to add

[user]
name = Naomi Ibe

in .git/config of the repository that you use to contribute to this project, e.g.,

    $ cd ... to the working tree of your clone of git you work in ...
    $ git config user.name "Naomi Ibe"

The space above your Sign off is to fill the details you omitted on the title of the message (which would say something about "conform to guidelines" or "clean up" without mentioning what rule the original violates), making the whole thing something like:

builtin/add.c: clean up die() messages

As described in the CodingGuidelines document, a single line message given to die() and its friends should not capitalize its first word, and should not add full-stop at the end.

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

Thanks. Otherwise the patch looks good.

Quoted 42 lines
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);
author
#2 lore raw

Thank you very much! I'd definitely make those changes on my next patch. Should I begin work on version 2 or should I still wait for additional input on the version 1?

Quoted 93 lines · Junio C Hamano
Quoted 1 line · Naomi Ibe

Subject: Re: [PATCH 1/1] [OUTREACHY] Fixed add.c file to conform to guidelines when using d

Subject: [OUTREACHY][PATCH 1/1] builtin/add.c: clean up die() messages

Quoted 1 line

From: Naomi <[email protected]>

The name and address on this line come from your commit object, which in turn would have came from your configuration. You have

[user]
name = Naomi
email = [email protected]

somewhere in your configuration file, perhaps in $HOME/.gitconfig or somewhere. When contributiong to this project, you want that "name" line to also include your family name, as it should match what you write on your Signed-off-by: line. A focused way to do so without affecting your author identity for other projects is to add

[user]
name = Naomi Ibe

in .git/config of the repository that you use to contribute to this project, e.g.,

    $ cd ... to the working tree of your clone of git you work in ...
    $ git config user.name "Naomi Ibe"

The space above your Sign off is to fill the details you omitted on the title of the message (which would say something about "conform to guidelines" or "clean up" without mentioning what rule the original violates), making the whole thing something like:

builtin/add.c: clean up die() messages

As described in the CodingGuidelines document, a single line message given to die() and its friends should not capitalize its first word, and should not add full-stop at the end.

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

Thanks. Otherwise the patch looks good.

Quoted 42 lines
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);
#3 lore raw
Quoted 4 lines · Naomi Ibe

Thank you very much! I'd definitely make those changes on my next patch. Should I begin work on version 2 or should I still wait for additional input on the version 1?

I think you can work on version 2. Also please reply inline instead of top-posting (see https://en.wikipedia.org/wiki/Posting_style).

#4 lore raw
In reply to Naomi Ibe
Quoted 1 line · Naomi Ibe

Thank you very much! I'd definitely make those changes on my next patch.

[administrivia] do not top post.

Quoted 2 lines

Should I begin work on version 2 or should I still wait for additional input on the version 1?

There is no "rule", but based on observations on how people behave, e.g.

* for a small patch like this that can be given a good review in 10 minutes or so, those who do not do so within the first 3 days will probably not do so.

* once a reasonably thorough review is given, those who haven't responded to the patch and do not have much else to say are unlikely to respond.

* on the other hand, after such a review is given, those who do not agree with the review tend to respond rather quickly, to get their voice in before it becomes too late.

I would say it would be good to start working on it right away and use a couple of days reviewing it yourself before posting it.

author
#5 lore raw

Okay then, I'll work with these guidelines in mind. Thank you very much

Quoted 27 lines · Junio C Hamano
Quoted 1 line · Naomi Ibe

Thank you very much! I'd definitely make those changes on my next patch.

[administrivia] do not top post.

Quoted 2 lines

Should I begin work on version 2 or should I still wait for additional input on the version 1?

There is no "rule", but based on observations on how people behave, e.g.

* for a small patch like this that can be given a good review in 10 minutes or so, those who do not do so within the first 3 days will probably not do so.

* once a reasonably thorough review is given, those who haven't responded to the patch and do not have much else to say are unlikely to respond.

* on the other hand, after such a review is given, those who do not agree with the review tend to respond rather quickly, to get their voice in before it becomes too late.

I would say it would be good to start working on it right away and use a couple of days reviewing it yourself before posting it.

#6 lore raw
Quoted 1 line · Naomi Ibe

Okay then, I'll work with these guidelines in mind. Thank you very much

If I may notice, avoiding top posting has already been suggested twice, IIRC.

I think that various webmails have made top posting popular, and actually forced people a bit to do that through the way their user interfaces were laid out, which made inline replies kind of a dying art, which is really sad to see. It is so much more useful when replies are posted inline, i.e. right below the contents they refer to.

Quoted 28 lines · Junio C Hamano
Quoted 27 lines
Quoted 1 line · Naomi Ibe

Thank you very much! I'd definitely make those changes on my next patch.

[administrivia] do not top post.

Quoted 2 lines

Should I begin work on version 2 or should I still wait for additional input on the version 1?

There is no "rule", but based on observations on how people behave, e.g.

* for a small patch like this that can be given a good review in 10 minutes or so, those who do not do so within the first 3 days will probably not do so.

* once a reasonably thorough review is given, those who haven't responded to the patch and do not have much else to say are unlikely to respond.

* on the other hand, after such a review is given, those who do not agree with the review tend to respond rather quickly, to get their voice in before it becomes too late.

I would say it would be good to start working on it right away and use a couple of days reviewing it yourself before posting it.