[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: df --output

From: Jim Meyering
Subject: Re: df --output
Date: Fri, 21 Sep 2012 11:28:03 +0200

Bernhard Voelker wrote:
> On 09/21/2012 09:34 AM, Jim Meyering wrote:
>> Bernhard Voelker wrote:
>> One nit: in NEWS (in 19/20), when a period is not at the end of the line,
>> put two spaces after it, not just one.  Same thing in --help output.
> I wonder if syntax-check couldn't prevent this ... didn't we have this
> already a few weeks ago?

Good idea.
It's definitely worth a try.  It will depend on how many
false positives there are.

>> There are several actually.  You can list them (and a few FPs) with
>>   git format-patch --stdout -20 |grep '\. [^ ]'
>> IMHO, the easiest way to fix them is to edit the git format-patch
>> output and re-apply it with "git am" to a fresh master-based branch.
>> (that works as long as inserting the space doesn't require splitting
>> a line in a patch -- it's fine to reformat logs when doing that, but
>> not patch output, of course)
>> Also, log typos:
>> s/brancket/bracket/
>> s/Accomodate/Accommodate/
>> ----------------------
> I changed the patch set by this command (several of the expressions
> exemt strings like "i.e." from being suffixed by 2 blanks):

Well, grammatically, "i.e." should almost always be followed by a comma:
i.e., "i.e.," ;-)
So, in general, those should be fixed, and thus they would not have
to be exempted in a syntax-check rule.

> sed -e 's/total \. /total "." /' \
>  -e 's/\. \([^ ]\)/.  \1/g' \
>  -e 's/\(i\.e\. \) /\1/g' \
>  -e 's/\(e\.g\. \) /\1/g' \
>  -e 's/\(\.\.\. \) /\1/g' \
>  -e 's/^\(+\. \) /\1/' \
>  -e 's/brancket/bracket/' \
>  -e 's/Accomodate/Accommodate/' \
>  -e 's/\(comma\) \(separated\)/\1-\2/' \
>  patches/df-output.patch
> And I had to split an overly-long log line.
> However, I didn't manage to 'git am':
>   ...
>   Applying: df: rename some displayable fields
>   error: patch failed: src/df.c:237
>   error: src/df.c: patch does not apply
>   Patch failed at 0002 df: rename some displayable fields
>   When you have resolved this problem run "git am --resolved".
>   If you would prefer to skip this patch, instead run "git am --skip".
>   To restore the original branch and stop patching run "git am --abort".
> I'm not used to this very much - how can I find out _why_ it didn't
> apply? That's a bit like "cannot print" while a "missing paper"
> diagnostic would have helped much more
> I'm a bit lost at this point :-(
> Any other idea?
> I could well fix the issues by commits 21, 22, ...

I applied your sed script and looked at the differences.
In the 4th chunk, your sed substitution changes a *context* line.

-           if (!cell) /* Missing type column, or mount point etc. */
+           if (!cell) /* Missing type column, or mount point etc.  */

That might actually be required, but you have to be careful of the
chronology.  I.e., farther down, it changed a line that is being deleted:

--          if (!cell) /* Missing type column, or mount point etc. */
+-          if (!cell) /* Missing type column, or mount point etc.  */

That is the problem.
In general, you don't want to do that, since then when
"git am" tries to remove that line, it'll find that it no longer
matches, due to the change.

The general rule is to change only "diff" lines that are being added
(i.e., with the leading "+" in unified diff output)
However, when an added line (that you want to change) appears
in the context of a later diff, *then* you'll have to change
it in the context, too.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]