doc: less guilt-foo invocations, minor Makefile fixes
cover doc: less guilt-foo invocations, minor Makefile fixes
guilt no longer supports running commands on the "guilt-add" form. You need to use "guilt add" instead.
This patch series updates most of the documentation to use the supported "guilt add" form.
There is one known instance where I did not change the style: in the NAME section in Documentation/guilt-*.txt. The reason is that if I change it there, xmlto will create the man pages as e.g. guilt_add.1 instead of guilt-add.1, and I don't know how to fix that. Also, the git man pages (as of Git 2.1.0) still have "git-add" under the NAME heading of git-add(1), so it might be wise to follow suite.
While working on this, I also found two minor issues with Documentation/Makefile.
/ceder
Per Cederqvist (5):
Fix generation of Documentation/usage-%.txt.
doc: guilt.xml depends on cmds.txt.
doc: don't use guilt-foo invocations in examples.
doc: don't use guilt-foo invocations in usage messages.
doc: git doesn't use git-foo invocations.
Documentation/.gitignore | 3 +++ Documentation/Makefile | 6 ++++-- Documentation/guilt-add.txt | 4 ++-- Documentation/guilt-delete.txt | 2 +- Documentation/guilt-diff.txt | 2 +- Documentation/guilt-help.txt | 4 ++-- Documentation/guilt-new.txt | 6 +++--- Documentation/guilt-refresh.txt | 2 +- Documentation/guilt-repair.txt | 2 +- Documentation/guilt-rm.txt | 2 +- Documentation/guilt-select.txt | 4 ++-- Documentation/usage.sh | 8 +++----- 12 files changed, 24 insertions(+), 21 deletions(-)
Signature · 1 line
2.1.0
PATCH 1/5 Fix generation of Documentation/usage-%.txt.
The old rule worked, most of the time, but had several issues:
- It depended on the corresponding guilt-*.txt file, but the usage.sh script actually reads ../guilt-foo.
- Actually, each usage-%.txt depended on all guilt-*.txt files, so make had to do more work than necessary if a single file was altered.
- The construct broke parallel make, which would spawn several usage.sh at once. This leads to unnecessary work, and could potentially result in broken usage files if the "echo some_string > some_file" construct used by usage.sh isn't atomic.
Fixed by letting the usage.sh script update a single file, and writing a proper implicit make rule. This makes parallel make work a lot better.
There is a small downside, though, as usage.sh will now be run once for each command (if everything is regenerated). I think it is worth to pay that price to get the correctness. This command is still very fast compared to the docbook processing.
--- Documentation/Makefile | 4 ++-- Documentation/usage.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-)
Documentation/Makefile +2 -2
@@ -66,8 +66,8 @@ clean: rm -f usage-*.txt rm -f version.txt -usage-%.txt: $(MAN1_TXT) usage.sh - sh ./usage.sh +usage-guilt-%.txt: ../guilt-% usage.sh + sh ./usage.sh $< %.html : %.txt footer.txt version.txt $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<
Documentation/usage.sh +3 -5
@@ -1,7 +1,5 @@ #!/bin/sh -for i in `ls ../guilt-*`; do - name=$(basename $i) - u=$(grep USAGE $i | sed 's/USAGE="//' | sed 's/"$//') - echo "'$name' $u" > usage-$name.txt -done +name=$(basename $1) +u=$(grep USAGE $1 | sed 's/USAGE="//' | sed 's/"$//') +echo "'$name' $u" > usage-$name.txt
Signature · 1 line
2.1.0
Re: [GUILT 1/5] Fix generation of Documentation/usage-%.txt.
Quoted 9 lines · Per Cederqvist
The old rule worked, most of the time, but had several issues:
- It depended on the corresponding guilt-*.txt file, but the
usage.shscript actually reads ../guilt-foo.- Actually, each usage-%.txt depended on all guilt-*.txt files, so make had to do more work than necessary if a single file was altered.
Quoted 8 lines
- The construct broke parallel make, which would spawn several
usage.shat once. This leads to unnecessary work, and could potentially result in broken usage files if the "echosome_string>some_file" construct used byusage.shisn't atomic.Fixed by letting the
usage.shscript update a single file, and writing a proper implicit make rule. This makes parallel make work a lot better.
Nice!
Quoted 4 lines
There is a small downside, though, as
usage.shwill now be run once for each command (if everything is regenerated). I think it is worth to pay that price to get the correctness. This command is still very fast compared to the docbook processing.
Given how much simple usage.sh got, I'm thinking it might be worth it to just remove it, and just shove the rule into the makefile itself.
Ok, I tried to write it. I came up with the following. (Note: I have *not* tested it.) It's not *that* ugly.
usage-guilt-%.txt: ../guilt-% usage.sh
echo "'$(basename $<)' `sed -n -e '/^USAGE=/{s/USAGE="//; s/"$//; p; q}' $<`" > $@What do you think? Too opaque? Your change looks good.
Jeff.
Quoted 39 lines
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/Makefile | 4 ++-- Documentation/usage.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-)Documentation/Makefile +2
-2@@ -66,8 +66,8 @@ clean: rm -f usage-*.txt rm -f version.txt -usage-%.txt: $(MAN1_TXT) usage.sh - sh ./usage.sh +usage-guilt-%.txt: ../guilt-% usage.sh + sh ./usage.sh $< %.html : %.txt footer.txt version.txt $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<Documentation/usage.sh +3
-5@@ -1,7 +1,5 @@ #!/bin/sh -for i in `ls ../guilt-*`; do - name=$(basename $i) - u=$(grep USAGE $i | sed 's/USAGE="//' | sed 's/"$//') - echo "'$name' $u" > usage-$name.txt -done +name=$(basename $1) +u=$(grep USAGE $1 | sed 's/USAGE="//' | sed 's/"$//') +echo "'$name' $u" > usage-$name.txtSignature · 1 line
2.1.0
Signature · 4 lines
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw
Re: [GUILT 1/5] Fix generation of Documentation/usage-%.txt.
Quoted 29 lines · Jeff Sipek
Quoted 9 lines · Per Cederqvist
The old rule worked, most of the time, but had several issues:
- It depended on the corresponding guilt-*.txt file, but the
usage.shscript actually reads ../guilt-foo.- Actually, each usage-%.txt depended on all guilt-*.txt files, so make had to do more work than necessary if a single file was altered.
Quoted 8 lines
- The construct broke parallel make, which would spawn several
usage.shat once. This leads to unnecessary work, and could potentially result in broken usage files if the "echosome_string>some_file" construct used byusage.shisn't atomic.Fixed by letting the
usage.shscript update a single file, and writing a proper implicit make rule. This makes parallel make work a lot better.Nice!
Quoted 4 lines
There is a small downside, though, as
usage.shwill now be run once for each command (if everything is regenerated). I think it is worth to pay that price to get the correctness. This command is still very fast compared to the docbook processing.Given how much simple
usage.shgot, I'm thinking it might be worth it to just remove it, and just shove the rule into the makefile itself.
Quoted 7 lines
Ok, I tried to write it. I came up with the following. (Note: I have *not* tested it.) It's not *that* ugly.
usage-guilt-%.txt: ../guilt-%
usage.shecho "'$(basename $<)' `sed -n -e '/^USAGE=/{s/USAGE="//; s/"$//; p; q}' $<`" > $@What do you think? Too opaque? Your change looks good.
Too opaque, and not tested enough. It doesn't work, since make will handle all $. You need to write $$ instead of $ in at least one of the places. I would stick with usage.sh, as getting the quoting right when you have make, shell, subshells, and sed all at the same time is just too painful.
But it is of course up to you. You are the maintainer. :-)
/ceder
Quoted 47 lines
Jeff.
Quoted 37 lines
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/Makefile | 4 ++-- Documentation/usage.sh | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-)Documentation/Makefile +2
-2@@ -66,8 +66,8 @@ clean: rm -f usage-*.txt rm -f version.txt -usage-%.txt: $(MAN1_TXT) usage.sh - sh ./usage.sh +usage-guilt-%.txt: ../guilt-% usage.sh + sh ./usage.sh $< %.html : %.txt footer.txt version.txt $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf $(ASCIIDOC_EXTRA) $<Documentation/usage.sh +3
-6@@ -1,7 +1,5 @@ #!/bin/sh -for i in `ls ../guilt-*`; do - name=$(basename $i) - u=$(grep USAGE $i | sed 's/USAGE="//' | sed 's/"$//') - echo "'$name' $u" > usage-$name.txt -done +name=$(basename $1) +u=$(grep USAGE $1 | sed 's/USAGE="//' | sed 's/"$//') +echo "'$name' $u" > usage-$name.txt --Quoted 2 lines
2.1.0
--
The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man.
- George Bernard Shaw
Re: [GUILT 1/5] Fix generation of Documentation/usage-%.txt.
Quoted 33 lines · Per Cederqvist
Quoted 32 lines · Jeff Sipek
Quoted 9 lines · Per Cederqvist
The old rule worked, most of the time, but had several issues:
- It depended on the corresponding guilt-*.txt file, but the
usage.shscript actually reads ../guilt-foo.- Actually, each usage-%.txt depended on all guilt-*.txt files, so make had to do more work than necessary if a single file was altered.
Quoted 8 lines
- The construct broke parallel make, which would spawn several
usage.shat once. This leads to unnecessary work, and could potentially result in broken usage files if the "echosome_string>some_file" construct used byusage.shisn't atomic.Fixed by letting the
usage.shscript update a single file, and writing a proper implicit make rule. This makes parallel make work a lot better.Nice!
Quoted 4 lines
There is a small downside, though, as
usage.shwill now be run once for each command (if everything is regenerated). I think it is worth to pay that price to get the correctness. This command is still very fast compared to the docbook processing.Given how much simple
usage.shgot, I'm thinking it might be worth it to just remove it, and just shove the rule into the makefile itself.Ok, I tried to write it. I came up with the following. (Note: I have *not* tested it.) It's not *that* ugly.
Quoted 6 lines
Quoted 4 lines
usage-guilt-%.txt: ../guilt-%
usage.shecho "'$(basename $<)' `sed -n -e '/^USAGE=/{s/USAGE="//; s/"$//; p; q}' $<`" > $@What do you think? Too opaque? Your change looks good.
Too opaque,
Between that and the other patch in the series that modifies usage.sh, your patch is good as is.
Quoted 5 lines
and not tested enough. It doesn't work, since make will handle all $. You need to write $$ instead of $ in at least one of the places. I would stick with
usage.sh, as getting the quoting right when you have make, shell, subshells, and sed all at the same time is just too painful.
And this is comming from the person that rewrote cmd/shouldfail in a way that the average shell user will go "whaaa??" :P (To be fair, I don't know of a simpler way to make cmd/shouldfail.)
Quoted 1 line
But it is of course up to you. You are the maintainer. :-)
Heh.
Jeff.
Signature · 4 lines
Real Programmers consider "what you see is what you get" to be just as bad a concept in Text Editors as it is in women. No, the Real Programmer wants a "you asked for it, you got it" text editor -- complicated, cryptic, powerful, unforgiving, dangerous.
PATCH 2/5 doc: guilt.xml depends on cmds.txt.
In reply to Per CederqvistSpecify an explicit dependency, to stop make from trying to generate guilt.xml if cmds.txt could not be created. The asciidoc will fail and produce an error message that might hide the original error message.
The added dependency causes make to not remove the guilt.xml file. Add *.xml to .gitignore.
--- Documentation/.gitignore | 3 +++ Documentation/Makefile | 2 ++ 2 files changed, 5 insertions(+)
Documentation/.gitignore +3 -0
@@ -11,3 +11,6 @@ version.txt # Generated file dependency list doc.dep + +# Intermediate generated files +*.xml
Documentation/Makefile +2 -0
@@ -60,6 +60,8 @@ cmds.txt: cmd-list.sh $(MAN1_TXT) guilt.7 guilt.html: guilt.txt footer.txt version.txt +guilt.xml: cmds.txt + clean: rm -f *.xml *.html *.1 *.7 doc.dep rm -f cmds.txt
Signature · 1 line
2.1.0
Re: [GUILT 2/5] doc: guilt.xml depends on cmds.txt.
Quoted 41 lines · Per Cederqvist
Specify an explicit dependency, to stop make from trying to generate guilt.xml if cmds.txt could not be created. The asciidoc will fail and produce an error message that might hide the original error message.
The added dependency causes make to not remove the guilt.xml file. Add *.xml to .gitignore.
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/.gitignore | 3 +++ Documentation/Makefile | 2 ++ 2 files changed, 5 insertions(+)Documentation/.gitignore +3
-0@@ -11,3 +11,6 @@ version.txt # Generated file dependency list doc.dep + +# Intermediate generated files +*.xmlDocumentation/Makefile +2
-0@@ -60,6 +60,8 @@ cmds.txt: cmd-list.sh $(MAN1_TXT) guilt.7 guilt.html: guilt.txt footer.txt version.txt +guilt.xml: cmds.txt + clean: rm -f *.xml *.html *.1 *.7 doc.dep rm -f cmds.txtSignature · 1 line
2.1.0
Signature · 3 lines
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. - Bill Gates, The Road Ahead, pg. 265
PATCH 3/5 doc: don't use guilt-foo invocations in examples.
In reply to Per CederqvistNote: there is one place where I replace guilt-repair with "guilt repair" instead of "+guilt repair+". At least the version of docbook I'm using mishandles the "+" signs in that particular spot (even though it works properly for "+guilt select+" in another file. I know too little docbook to be able to find the cause.
--- Documentation/guilt-add.txt | 2 +- Documentation/guilt-delete.txt | 2 +- Documentation/guilt-diff.txt | 2 +- Documentation/guilt-help.txt | 4 ++-- Documentation/guilt-new.txt | 6 +++--- Documentation/guilt-repair.txt | 2 +- Documentation/guilt-select.txt | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-)
Documentation/guilt-add.txt +1 -1
@@ -24,7 +24,7 @@ EXAMPLES Create and add a new file example.c $ touch example.c - $ guilt-add example.c + $ guilt add example.c Author ------
Documentation/guilt-delete.txt +1 -1
@@ -25,7 +25,7 @@ EXAMPLES -------- Delete a patch called 'foobar': - $ guilt-delete foobar + $ guilt delete foobar Author ------
Documentation/guilt-diff.txt +1 -1
@@ -18,7 +18,7 @@ OPTIONS ------- -z:: Output a interdiff against the top-most applied patch. This should - produce the same diff as "+guilt-new -f foo+". + produce the same diff as "+guilt new -f foo+". <path>...:: Restrict diff output to a given set of files.
Documentation/guilt-help.txt +2 -2
@@ -18,11 +18,11 @@ EXAMPLES Open the guilt-status man page - $ guilt-help status + $ guilt help status Open the guilt man page - $ guilt-help + $ guilt help Author ------
Documentation/guilt-new.txt +3 -3
@@ -42,16 +42,16 @@ EXAMPLES Create a new patch called 'foobar': - $ guilt-new foobar + $ guilt new foobar Create a patch called 'foo' and supply a patch description interactively: - $ guilt-new -e foo + $ guilt new -e foo Create a patch called 'bar' with a provided patch description and sign off on the patch: - $ guilt-new -s -m patch-fu bar + $ guilt new -s -m patch-fu bar Author ------
Documentation/guilt-repair.txt +1 -1
@@ -22,7 +22,7 @@ Perform various repository repairs. You must specify one mode of repair: WARNING: Running this command may result in commits and working directory changes being lost. You may want to create a new reference (e.g., branch, or reflog) to the original HEAD before using - guilt-repair. + "guilt repair". --status:: Upgrade the status file from old format to new.
Documentation/guilt-select.txt +2 -2
@@ -19,10 +19,10 @@ the following way: * An unguarded patch is always applied. * A patch with a positive guard is applied *only* if the guard is -selected with guilt-select. +selected with "+guilt select+". * A patch with a negative guard is applied *unless* the guard is -selected with guilt-select. +selected with "+guilt select+". OPTIONS -------
Signature · 1 line
2.1.0
Re: [GUILT 3/5] doc: don't use guilt-foo invocations in examples.
Quoted 5 lines · Per Cederqvist
Note: there is one place where I replace guilt-repair with "guilt repair" instead of "+guilt repair+". At least the version of docbook I'm using mishandles the "+" signs in that particular spot (even though it works properly for "+guilt select+" in another file. I know too little docbook to be able to find the cause.
Yeah, a bit of a mystery to me too. Regardless,
Quoted 125 lines
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/guilt-add.txt | 2 +- Documentation/guilt-delete.txt | 2 +- Documentation/guilt-diff.txt | 2 +- Documentation/guilt-help.txt | 4 ++-- Documentation/guilt-new.txt | 6 +++--- Documentation/guilt-repair.txt | 2 +- Documentation/guilt-select.txt | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-)Documentation/guilt-add.txt +1
-1@@ -24,7 +24,7 @@ EXAMPLES Create and add a new file example.c $ touch example.c - $ guilt-add example.c + $ guilt add example.c Author ------Documentation/guilt-delete.txt +1
-1@@ -25,7 +25,7 @@ EXAMPLES -------- Delete a patch called 'foobar': - $ guilt-delete foobar + $ guilt delete foobar Author ------Documentation/guilt-diff.txt +1
-1@@ -18,7 +18,7 @@ OPTIONS ------- -z:: Output a interdiff against the top-most applied patch. This should - produce the same diff as "+guilt-new -f foo+". + produce the same diff as "+guilt new -f foo+". <path>...:: Restrict diff output to a given set of files.Documentation/guilt-help.txt +2
-2@@ -18,11 +18,11 @@ EXAMPLES Open the guilt-status man page - $ guilt-help status + $ guilt help status Open the guilt man page - $ guilt-help + $ guilt help Author ------Documentation/guilt-new.txt +3
-3@@ -42,16 +42,16 @@ EXAMPLES Create a new patch called 'foobar': - $ guilt-new foobar + $ guilt new foobar Create a patch called 'foo' and supply a patch description interactively: - $ guilt-new -e foo + $ guilt new -e foo Create a patch called 'bar' with a provided patch description and sign off on the patch: - $ guilt-new -s -m patch-fu bar + $ guilt new -s -m patch-fu bar Author ------Documentation/guilt-repair.txt +1
-1@@ -22,7 +22,7 @@ Perform various repository repairs. You must specify one mode of repair: WARNING: Running this command may result in commits and working directory changes being lost. You may want to create a new reference (e.g., branch, or reflog) to the original HEAD before using - guilt-repair. + "guilt repair". --status:: Upgrade the status file from old format to new.Documentation/guilt-select.txt +2
-2@@ -19,10 +19,10 @@ the following way: * An unguarded patch is always applied. * A patch with a positive guard is applied *only* if the guard is -selected with guilt-select. +selected with "+guilt select+". * A patch with a negative guard is applied *unless* the guard is -selected with guilt-select. +selected with "+guilt select+". OPTIONS -------Signature · 1 line
2.1.0
Signature · 4 lines
mainframe, n.: An obsolete device still used by thousands of obsolete companies serving billions of obsolete customers and making huge obsolete profits for their obsolete shareholders. And this year's run twice as fast as last year's.
PATCH 4/5 doc: don't use guilt-foo invocations in usage messages.
In reply to Per Cederqvist--- Documentation/usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/usage.sh +1 -1
@@ -2,4 +2,4 @@ name=$(basename $1) u=$(grep USAGE $1 | sed 's/USAGE="//' | sed 's/"$//') -echo "'$name' $u" > usage-$name.txt +echo "'`echo $name|sed -e 's/^guilt-/guilt /'`' $u" > usage-$name.txt
Signature · 1 line
2.1.0
Re: [GUILT 4/5] doc: don't use guilt-foo invocations in usage messages.
Ah, I see you changed usage.sh here. I guess that kinda invalidates my comment for patch 1/5.
Quoted 10 lines · Per Cederqvist
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/usage.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/usage.sh +0
-0
Documentation/usage.sh line 5
Quoted 5 lines
Documentation/usage.sh +1
-1@@ -2,4 +2,4 @@ name=$(basename $1) u=$(grep USAGE $1 | sed 's/USAGE="//' | sed 's/"$//') -echo "'$name' $u" > usage-$name.txt +echo "'`echo $name|sed -e 's/^guilt-/guilt /'`' $u" > usage-$name.txt
Tiny nitpick: spaces around the |, otherwise looks good.
Quoted 3 lines
Signature · 1 line
2.1.0
Signature · 1 line
Si hoc legere scis nimium eruditionis habes.
PATCH 5/5 doc: git doesn't use git-foo invocations.
In reply to Per CederqvistMake them into reference to the man pages instead.
--- Documentation/guilt-add.txt | 2 +- Documentation/guilt-refresh.txt | 2 +- Documentation/guilt-rm.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Documentation/guilt-add.txt +1 -1
@@ -11,7 +11,7 @@ include::usage-guilt-add.txt[] DESCRIPTION ----------- -Adds the files specified to git using git-add making it available to guilt. +Adds the files specified to git using git-add(1) making it available to guilt. OPTIONS -------
Documentation/guilt-refresh.txt +1 -1
@@ -23,7 +23,7 @@ OPTIONS Include a diffstat output in the patch file. Useful for cases where patches will be submitted with other tools. + -If the command line option is omitted, the corresponding git-config +If the command line option is omitted, the corresponding git-config(1) option "guilt.diffstat" will be queried. So this would enable diffstat output by default:
Documentation/guilt-rm.txt +1 -1
@@ -11,7 +11,7 @@ include::usage-guilt-rm.txt[] DESCRIPTION ----------- -Removes the files specified from git using git-rm +Removes the files specified from git using git-rm(1). OPTIONS -------
Signature · 1 line
2.1.0
Re: [GUILT 5/5] doc: git doesn't use git-foo invocations.
Quoted 51 lines · Per Cederqvist
Make them into reference to the man pages instead.
Signed-off-by Per Cederqvist <[email protected]>--- Documentation/guilt-add.txt | 2 +- Documentation/guilt-refresh.txt | 2 +- Documentation/guilt-rm.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)Documentation/guilt-add.txt +1
-1@@ -11,7 +11,7 @@ include::usage-guilt-add.txt[] DESCRIPTION ----------- -Adds the files specified to git using git-add making it available to guilt. +Adds the files specified to git using git-add(1) making it available to guilt. OPTIONS -------Documentation/guilt-refresh.txt +1
-1@@ -23,7 +23,7 @@ OPTIONS Include a diffstat output in the patch file. Useful for cases where patches will be submitted with other tools. + -If the command line option is omitted, the corresponding git-config +If the command line option is omitted, the corresponding git-config(1) option "guilt.diffstat" will be queried. So this would enable diffstat output by default:Documentation/guilt-rm.txt +1
-1@@ -11,7 +11,7 @@ include::usage-guilt-rm.txt[] DESCRIPTION ----------- -Removes the files specified from git using git-rm +Removes the files specified from git using git-rm(1). OPTIONS -------Signature · 1 line
2.1.0
Signature · 3 lines
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. - Bill Gates, The Road Ahead, pg. 265