Re: sendbug subject
Mon, 16 May 2016 00:01:59 +0200 Jeremie Courreges-Anglas> "trondd" writes: > > > On Sun, May 15, 2016 1:22 pm, Juan Francisco Cantero Hurtado wrote: > >> On Sun, May 15, 2016 at 06:43:16PM +0200, Jeremie Courreges-Anglas wrote: > >>> "Ted Unangst" writes: > >>> > >>> > i'm tired of seeing bug reports with no subject. i also get a fair bit > >>> of spam > >>> > with no subject and i am easily confused. something is better than > >>> nothing. > >>> > >>> I fear that after that change all bug reports will only have [bug > >>> report] as Subject. Something that wouldn't catch the eye of people > >>> that might be able to understand and fix the problem. > >> > > > > Why not make Subject a required field? Might want to also add a comment > > there like Category and Synopsis have. > > I like this idea, but those are not "required" fields. Also I don't > find the warning message helpful. > > Here's a patch that builds up on Tim's diff. Tell the user which fields > should be filled in, in the order where they are found in the bugreport. An idea, how about form it Subject: [bugrep] subject, or whatever you would prefer in the brackets, to discern the subjects when intermixed. Apologies for not backing this humble useless suggestion with a patch. > Index: sendbug.c > === > RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v > retrieving revision 1.74 > diff -u -p -p -u -r1.74 sendbug.c > --- sendbug.c 17 Mar 2016 19:40:43 - 1.74 > +++ sendbug.c 15 May 2016 21:53:39 - > @@ -30,7 +30,7 @@ > #define BEGIN64 "begin-base64 " > #define END64 "" > > -int checkfile(const char *); > +void checkfile(const char *); > void debase(void); > void dmesg(FILE *); > int editit(const char *); > @@ -164,8 +164,7 @@ main(int argc, char *argv[]) > errx(1, "report unchanged, nothing sent"); > > prompt: > - if (!checkfile(tmppath)) > - fprintf(stderr, "fields are blank, must be filled in\n"); > + checkfile(tmppath); > c = prompt(); > switch (c) { > case 'a': > @@ -508,26 +507,37 @@ matchline(const char *s, const char *lin > /* > * Are all required fields filled out? > */ > -int > +void > checkfile(const char *pathname) > { > FILE *fp; > size_t len; > - int category = 0, synopsis = 0; > + int category = 0, synopsis = 0, subject = 0; > char *buf; > > if ((fp = fopen(pathname, "r")) == NULL) { > warn("%s", pathname); > - return (0); > + return; > } > while ((buf = fgetln(fp, ))) { > if (matchline(">Category:", buf, len)) > category = 1; > else if (matchline(">Synopsis:", buf, len)) > synopsis = 1; > + else if (matchline("Subject:", buf, len)) > + subject = 1; > } > fclose(fp); > - return (category && synopsis); > + if (!category || !synopsis || !subject) { > + fprintf(stderr, "Some fields are blank, please fill them in: "); > + if (!subject) > + fprintf(stderr, "Subject "); > + if (!synopsis) > + fprintf(stderr, "Synopsis "); > + if (!category) > + fprintf(stderr, "Category "); > + fputc('\n', stderr); > + } > } > > void >
Re: sendbug subject
"trondd"writes: > On Sun, May 15, 2016 1:22 pm, Juan Francisco Cantero Hurtado wrote: >> On Sun, May 15, 2016 at 06:43:16PM +0200, Jeremie Courreges-Anglas wrote: >>> "Ted Unangst" writes: >>> >>> > i'm tired of seeing bug reports with no subject. i also get a fair bit >>> of spam >>> > with no subject and i am easily confused. something is better than >>> nothing. >>> >>> I fear that after that change all bug reports will only have [bug >>> report] as Subject. Something that wouldn't catch the eye of people >>> that might be able to understand and fix the problem. >> > > Why not make Subject a required field? Might want to also add a comment > there like Category and Synopsis have. I like this idea, but those are not "required" fields. Also I don't find the warning message helpful. Here's a patch that builds up on Tim's diff. Tell the user which fields should be filled in, in the order where they are found in the bugreport. Index: sendbug.c === RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.74 diff -u -p -p -u -r1.74 sendbug.c --- sendbug.c 17 Mar 2016 19:40:43 - 1.74 +++ sendbug.c 15 May 2016 21:53:39 - @@ -30,7 +30,7 @@ #define BEGIN64 "begin-base64 " #define END64 "" -intcheckfile(const char *); +void checkfile(const char *); void debase(void); void dmesg(FILE *); inteditit(const char *); @@ -164,8 +164,7 @@ main(int argc, char *argv[]) errx(1, "report unchanged, nothing sent"); prompt: - if (!checkfile(tmppath)) - fprintf(stderr, "fields are blank, must be filled in\n"); + checkfile(tmppath); c = prompt(); switch (c) { case 'a': @@ -508,26 +507,37 @@ matchline(const char *s, const char *lin /* * Are all required fields filled out? */ -int +void checkfile(const char *pathname) { FILE *fp; size_t len; - int category = 0, synopsis = 0; + int category = 0, synopsis = 0, subject = 0; char *buf; if ((fp = fopen(pathname, "r")) == NULL) { warn("%s", pathname); - return (0); + return; } while ((buf = fgetln(fp, ))) { if (matchline(">Category:", buf, len)) category = 1; else if (matchline(">Synopsis:", buf, len)) synopsis = 1; + else if (matchline("Subject:", buf, len)) + subject = 1; } fclose(fp); - return (category && synopsis); + if (!category || !synopsis || !subject) { + fprintf(stderr, "Some fields are blank, please fill them in: "); + if (!subject) + fprintf(stderr, "Subject "); + if (!synopsis) + fprintf(stderr, "Synopsis "); + if (!category) + fprintf(stderr, "Category "); + fputc('\n', stderr); + } } void -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
Re: sendbug subject
On Sun, May 15, 2016 1:22 pm, Juan Francisco Cantero Hurtado wrote: > On Sun, May 15, 2016 at 06:43:16PM +0200, Jeremie Courreges-Anglas wrote: >> "Ted Unangst"writes: >> >> > i'm tired of seeing bug reports with no subject. i also get a fair bit >> of spam >> > with no subject and i am easily confused. something is better than >> nothing. >> >> I fear that after that change all bug reports will only have [bug >> report] as Subject. Something that wouldn't catch the eye of people >> that might be able to understand and fix the problem. > Why not make Subject a required field? Might want to also add a comment there like Category and Synopsis have. Tim. Index: sendbug.c === RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.74 diff -u -p -r1.74 sendbug.c --- sendbug.c 17 Mar 2016 19:40:43 - 1.74 +++ sendbug.c 15 May 2016 21:10:00 - @@ -513,7 +513,7 @@ checkfile(const char *pathname) { FILE *fp; size_t len; - int category = 0, synopsis = 0; + int category = 0, synopsis = 0, subject = 0; char *buf; if ((fp = fopen(pathname, "r")) == NULL) { @@ -525,9 +525,11 @@ checkfile(const char *pathname) category = 1; else if (matchline(">Synopsis:", buf, len)) synopsis = 1; + else if (matchline("Subject:", buf, len)) + subject = 1; } fclose(fp); - return (category && synopsis); + return (category && synopsis && subject); } void
Re: sendbug subject
On Sun, May 15, 2016 at 06:43:16PM +0200, Jeremie Courreges-Anglas wrote: > "Ted Unangst"writes: > > > i'm tired of seeing bug reports with no subject. i also get a fair bit of > > spam > > with no subject and i am easily confused. something is better than nothing. > > I fear that after that change all bug reports will only have [bug > report] as Subject. Something that wouldn't catch the eye of people > that might be able to understand and fix the problem. How about this? hw.machine + kern.osrelease + hw.product [sendbug] macppc 6.0 PowerBook5,2 -- Juan Francisco Cantero Hurtado http://juanfra.info
Re: sendbug subject
"Ted Unangst"writes: > i'm tired of seeing bug reports with no subject. i also get a fair bit of spam > with no subject and i am easily confused. something is better than nothing. I fear that after that change all bug reports will only have [bug report] as Subject. Something that wouldn't catch the eye of people that might be able to understand and fix the problem. -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
sendbug subject
i'm tired of seeing bug reports with no subject. i also get a fair bit of spam with no subject and i am easily confused. something is better than nothing. Index: sendbug.c === RCS file: /cvs/src/usr.bin/sendbug/sendbug.c,v retrieving revision 1.74 diff -u -p -r1.74 sendbug.c --- sendbug.c 17 Mar 2016 19:40:43 - 1.74 +++ sendbug.c 15 May 2016 16:15:40 - @@ -543,7 +543,7 @@ template(FILE *fp) fprintf(fp, "SENDBUG:\n"); fprintf(fp, "SENDBUG:\n"); fprintf(fp, "To: %s\n", "b...@openbsd.org"); - fprintf(fp, "Subject: \n"); + fprintf(fp, "Subject: [bug report]\n"); fprintf(fp, "From: %s\n", pw->pw_name); fprintf(fp, "Cc: %s\n", pw->pw_name); fprintf(fp, "Reply-To: %s\n", pw->pw_name);