From: Alexander Kuleshov <hidden> Date: 2016-06-15 23:05:24
We can pass -o/--output-directory to the format-patch command to
store patches not in the working directory. This patch introduces
format.outputDirectory configuration option for same purpose.
The case of usage of this configuration option can be convinience
to not pass everytime -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
---
Documentation/config.txt | 4 ++++
Documentation/git-format-patch.txt | 6 +++++-
builtin/log.c | 8 ++++++++
t/t4014-format-patch.sh | 18 ++++++++++++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
@@ -1262,6 +1262,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the seting 'format.outputDirectory' configuration option.+If `-o` is specified and 'format.outputDirectory' is set, output files+will be stored in a <dir> that passed to `-o`. When 'format.outputDirectory'+is set to get default behaviour back is to pass './' to the `-o`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank
From: Eric Sunshine <hidden> Date: 2016-06-15 23:05:24
On Fri, Jun 19, 2015 at 2:28 PM, Alexander Kuleshov
[off-list ref] wrote:
We can pass -o/--output-directory to the format-patch command to
store patches not in the working directory. This patch introduces
format.outputDirectory configuration option for same purpose.
The case of usage of this configuration option can be convinience
s/convinience/convenience/
to not pass everytime -o/--output-directory if an user has pattern
s/everytime/every time/
quoted hunk
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
---
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the seting 'format.outputDirectory' configuration option.
s/seting/setting/ or s/seting//
+If `-o` is specified and 'format.outputDirectory' is set, output files
+will be stored in a <dir> that passed to `-o`. When 'format.outputDirectory'
+is set to get default behaviour back is to pass './' to the `-o`.
s/set/set,/
quoted hunk
By default, the subject of a single patch is "[PATCH] " followed by
the concatenation of lines from the commit message up to the first blank
Move the test_config line to the top of the test and get rid of the
'git config --unset' line since test_config will unset the
configuration automatically.
Don't use test_must_fail for non-git commands. Instead, use '!'.
However, in this case, using:
test_path_is_missing patches &&
would make the intent more clear.
From: Stephen P. Smith <hidden> Date: 2016-06-15 23:07:40
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to
store patches not in the working directory. This patch introduces
format.outputDirectory configuration option for same purpose.
The case of usage of this configuration option can be convinience
to not pass everytime -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Re-rolled patch by following review comments in:
http://article.gmane.org/gmane.comp.version-control.git/272199http://article.gmane.org/gmane.comp.version-control.git/278354http://article.gmane.org/gmane.comp.version-control.git/278365
Changes include:
* Specifying the patches directory as an argument to ls
* Not initialize config_output_directory to NULL
* Grammar fixes in documentation
* Use test_config rather than git config
Documentation/config.txt | 4 ++++
Documentation/git-format-patch.txt | 6 +++++-
builtin/log.c | 7 +++++++
t/t4014-format-patch.sh | 13 +++++++++++++
4 files changed, 29 insertions(+), 1 deletion(-)
@@ -1243,6 +1243,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the setting 'format.outputDirectory' configuration option.+If `-o` is specified and 'format.outputDirectory' is set, output files+will be stored in a <dir> that passed to `-o`. When 'format.outputDirectory'+is set, to get default behaviour back is to pass './' to the `-o`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank
From: Eric Sunshine <hidden> Date: 2016-06-15 23:07:40
Thanks for reviving this abandoned patch. Please see review comments
below, some of which repeat comments from the previous attempt[1], and
some of which are new. Most of the new ones are minor, although there
is at least one major problem.
On Sat, Jan 9, 2016 at 9:30 PM, Stephen P. Smith [off-list ref] wrote:
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to
store patches not in the working directory. This patch introduces
s/not in/in some place other than/
format.outputDirectory configuration option for same purpose.
The case of usage of this configuration option can be convinience
From [1]: s/convinience/convenience/
to not pass everytime -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the setting 'format.outputDirectory' configuration option.
s/setting//
+If `-o` is specified and 'format.outputDirectory' is set, output files
+will be stored in a <dir> that passed to `-o`. When 'format.outputDirectory'
+is set, to get default behaviour back is to pass './' to the `-o`.
This is difficult to read. How about replacing these two sentences
with something like this:
The `-o` option takes precedence over `format.outputDirectory`.
To store patches in the current working directory even when
`format.outputDirectory` points elsewhere, use `-o .`.
Rather than adding new tests at the very top of the script, it's more
common to add them to the bottom or at least to insert them after
other similar tests.
We can drop the unnecessary quotes around "patches".
Also, can we drop the unnecessary "/"?
+ git format-patch master..side &&
Since this test is about verifying that the "patches" directory got
created and used, you want to be more careful about ensuring that
detritus from preceding tests won't muck up your results; for
instance, if an earlier test had also used a directory named "patches"
and had dumped 42 files there instead of the 3 expected by this test.
Therefore, you should insert "rm -fr patches &&" before the
git-format-patch invocation.
+ cnt=$(ls patches | wc -l) &&
+ test $cnt = 3
Periodically, we have trouble with the output of "wc -l" on Mac OS X
since the output has leading spaces. This code doesn't trip over that
problem since it doesn't quote the output, but it still feels fragile
to be comparing the it against a number using the string equality test
'='. How about using the '-eq' numeric equality test instead?
Moreover, there is no need for the temporary 'cnt' variable. Instead:
test $(ls patches | wc -l) -eq 3 &&
Depending upon taste, you might alternately use:
ls patches >actual &&
test_line_count = 3 actual
which would give you more useful debugging output upon failure.
+'
+
+test_expect_success "format-patch format.outputDirectory overwritten with -o" '
Use single- rather than double-qoutes: s/"/'/
Also, how about rewording it?
'format-patch -o overrides format.outputDirectory'
Style: drop unnecessary quotes around "patches"
Style: drop unnecessary "/"
+ git format-patch master..side -o "." &&
Style: drop unnecessary quotes around "."
+ test_path_is_missing patches/
Style: drop unnecessary "/"
There is a rather severe problem with this test in that it fails
unconditionally. It wants to verify that -o takes precedence over
format.outputDirectory by checking that the directory "patches" did
not get created by git-format-patch, however, that directory already
exists since it was created by the previous test, thus
test_path_is_missing() fails. Therefore, you should insert "rm -fr
patches &&" before the git-format-patch invocation.
It also might not hurt to make the test a bit more robust by verifying
not only that the directory specified by format.outputDirectory did
not get created, but that the directory named by -o did get created,
which means giving -o an argument other than ".". So, the final test
might look like this:
test_config format.outputDirectory patches &&
rm -fr patches patchset &&
git format-patch master..side -o patchset &&
test_path_is_missing patches &&
test_path_is_dir patchset
From: Stephen P. Smith <hidden> Date: 2016-06-15 23:07:41
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convinience
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Updated based on http://article.gmane.org/gmane.comp.version-control.git/283613
Commit message changes:
s/not in/in some place other than/.
s/everytime/every time/.
git-format-patch.txt change:
s/setting//.
applied the two sentence wording change.
t4014-format-patch.sh:
moved tests to the end of the test suite.
added rm commands to remove directory prior to testing.
changed directory name style issues.
Documentation/config.txt | 4 ++++
Documentation/git-format-patch.txt | 6 +++++-
builtin/log.c | 7 +++++++
t/t4014-format-patch.sh | 16 ++++++++++++++++
4 files changed, 32 insertions(+), 1 deletion(-)
@@ -1243,6 +1243,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the 'format.outputDirectory' configuration option.+The `-o` option takes precedence over `format.outputDirectory`.+To store patches in the current working directory even when+`format.outputDirectory` points elsewhere, use `-o .`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank
From: Eric Sunshine <hidden> Date: 2016-06-15 23:07:41
On Sun, Jan 10, 2016 at 7:30 PM, Stephen P. Smith [off-list ref] wrote:
quoted hunk
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convinience
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Now that you've moved the new tests to the bottom of the script, this
test fails. This is because, at this point, there are 18 commits in
the range 'master..side', not 3 as when the test was at the top of the
script. You could change the 3 to an 18, however, that would be
fragile: if someone inserts or modifies tests above this one, then a
hard-coded 18 might become stale. One possible fix would be:
test $(git rev-list master..side | wc -l) -eq $(ls patches)
You could also take the stance that you're not so much interested in
the number of patches in the range 'master..side' but rather you
merely care about the fact that the "patches" directory got created
and some patches were deposited there. In that case, you might do this
instead:
git format-patch -3 side &&
ls patches >actual &&
test_line_count = 3 actual
I don't feel strongly about it either way, but whichever approach you
choose, please do build the project and run this test script to ensure
that it succeeds before submitting v5. Thanks.
Now that you've moved the new tests to the bottom of the script, this
test fails. This is because, at this point, there are 18 commits in
the range 'master..side', not 3 as when the test was at the top of the
script. You could change the 3 to an 18, however, that would be
fragile: if someone inserts or modifies tests above this one, then a
hard-coded 18 might become stale. One possible fix would be:
test $(git rev-list master..side | wc -l) -eq $(ls patches)
From: Stephen P. Smith <hidden> Date: 2016-06-15 23:07:43
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convinience
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Fixed bug which was found when moving the tests to the end of the
script by removing the hardcoded expected count and replacing with a
computation of the number of actual patches.
Mailing list web interface is again not working; therefore, I don't
have URLs for the earlier review comments.
Documentation/config.txt | 4 ++++
Documentation/git-format-patch.txt | 6 +++++-
builtin/log.c | 7 +++++++
t/t4014-format-patch.sh | 15 +++++++++++++++
4 files changed, 31 insertions(+), 1 deletion(-)
@@ -1243,6 +1243,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the 'format.outputDirectory' configuration option.+The `-o` option takes precedence over `format.outputDirectory`.+To store patches in the current working directory even when+`format.outputDirectory` points elsewhere, use `-o .`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank
From: Eric Sunshine <hidden> Date: 2016-06-15 23:07:43
On Tue, Jan 12, 2016 at 11:48 PM, Stephen P. Smith [off-list ref] wrote:
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convinience
Mentioned several times already: s/convinience/convenience/
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Fixed bug which was found when moving the tests to the end of the
script by removing the hardcoded expected count and replacing with a
computation of the number of actual patches.
Thanks, this version looks better. Aside from the misspelling above
and a minor comment below, this version is:
Reviewed-by: Eric Sunshine <redacted>
Mailing list web interface is again not working; therefore, I don't
have URLs for the earlier review comments.
I don't care strongly, but I wonder why this new variable is placed
below the enum rather than being grouped with other similar variables
just above this enum. (Probably not worth a re-roll, though.)
static int git_format_config(const char *var, const char *value, void *cb)
{
if (!strcmp(var, "format.headers")) {
From: Stephen P. Smith <hidden> Date: 2016-06-15 23:07:44
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convenience
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Fixed s/convinience/convenience/
Moved 'static const char *config_output_directory;' to be with othe
similarly typed variables.
The full set of attempts is here [1].
[1]: http://thread.gmane.org/gmane.comp.version-control.git/272180
Documentation/config.txt | 4 ++++
Documentation/git-format-patch.txt | 6 +++++-
builtin/log.c | 6 ++++++
t/t4014-format-patch.sh | 15 +++++++++++++++
4 files changed, 30 insertions(+), 1 deletion(-)
@@ -1243,6 +1243,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the 'format.outputDirectory' configuration option.+The `-o` option takes precedence over `format.outputDirectory`.+To store patches in the current working directory even when+`format.outputDirectory` points elsewhere, use `-o .`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank
From: Eric Sunshine <hidden> Date: 2016-06-15 23:07:44
On Wed, Jan 13, 2016 at 8:20 AM, Stephen P. Smith [off-list ref] wrote:
From: Alexander Kuleshov <redacted>
We can pass -o/--output-directory to the format-patch command to store
patches in some place other than the working directory. This patch
introduces format.outputDirectory configuration option for same
purpose.
The case of usage of this configuration option can be convenience
to not pass every time -o/--output-directory if an user has pattern
to store all patches in the /patches directory for example.
The format.outputDirectory has lower priority than command line
option, so if user will set format.outputDirectory and pass the
command line option, a result will be stored in a directory that
passed to command line option.
Signed-off-by: Alexander Kuleshov <redacted>
Signed-off-by: Stephen P. Smith <redacted>
---
Notes:
Fixed s/convinience/convenience/
Moved 'static const char *config_output_directory;' to be with othe
similarly typed variables.
Thanks. This version is also:
Reviewed-by: Eric Sunshine <redacted>
(A note for future submissions of other patches: Once a person has
given a Reviewed-by:, you're welcome to include the Reviewed-by: in a
re-roll provided that the re-roll doesn't change anything which would
obviously invalidate the Reviewed-by:. In this particular case, for
instance, v6 merely fixed a couple very minor nits mentioned in my v5
review, so it would have been perfectly acceptable to include my
Reviewed-by: in v6.)
@@ -1243,6 +1243,10 @@ format.coverLetter:: format-patch is invoked, but in addition can be set to "auto", to generate a cover-letter only when there's more than one patch.+format.outputDirectory::+ Set a custom directory to store the resulting files instead of the+ current working directory.+ filter.<driver>.clean:: The command which is used to convert the content of a worktree file to a blob upon checkin. See linkgit:gitattributes[5] for
@@ -57,7 +57,11 @@ The names of the output files are printed to standard output, unless the `--stdout` option is specified. If `-o` is specified, output files are created in <dir>. Otherwise-they are created in the current working directory.+they are created in the current working directory. The default path+can be set with the 'format.outputDirectory' configuration option.+The `-o` option takes precedence over `format.outputDirectory`.+To store patches in the current working directory even when+`format.outputDirectory` points elsewhere, use `-o .`. By default, the subject of a single patch is "[PATCH] " followed by the concatenation of lines from the commit message up to the first blank