Re: [msysGit] [PATCH v2 10/16] engine.pl: delete the captured stderr file if empty

2015-07-19 Thread Eric Sunshine
On Mon, Jul 20, 2015 at 2:16 AM, Philip Oakley wrote: > From: "Eric Sunshine" >> On Sun, Jul 19, 2015 at 4:08 PM, Philip Oakley >> wrote: >>> Keep the build clean of extraneous files if it is indeed clean. >>> Otherwise leave the msvc-build-makedryerrors.txt file both as >>> a flag for any CI sy

Re: [PATCH v3 5/9] ref-filter: add option to match literal pattern

2015-07-19 Thread Eric Sunshine
On Sat, Jul 18, 2015 at 3:12 PM, Karthik Nayak wrote: > Since 'ref-filter' only has an option to match path names add an > option for plain fnmatch pattern-matching. > > This is to support the pattern matching options which are used in `git > tag -l` and `git branch -l` where we can match patterns

Re: [msysGit] [PATCH v2 10/16] engine.pl: delete the captured stderr file if empty

2015-07-19 Thread Philip Oakley
From: "Eric Sunshine" On Sun, Jul 19, 2015 at 4:08 PM, Philip Oakley wrote: Keep the build clean of extraneous files if it is indeed clean. Otherwise leave the msvc-build-makedryerrors.txt file both as a flag for any CI system or for manual debugging. Note that the file will contain the new v

Re: [msysGit] [PATCH v2 08/16] engine.pl: ignore invalidcontinue.obj which is known to MSVC

2015-07-19 Thread Philip Oakley
From: "Eric Sunshine" Sent: Monday, July 20, 2015 2:54 AM On Sun, Jul 19, 2015 at 4:08 PM, Philip Oakley wrote: Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX compatibility, 2014-03-29) is not processed correctly by the buildsystem. Ignore it. What does "not processed cor

Re: How to use --cc-cmd in git-send-email?

2015-07-19 Thread Eric Sunshine
On Mon, Jul 20, 2015 at 2:01 AM, Philip Oakley wrote: > From: "Eric Sunshine" >> git-send-email invokes the cc-cmd like this: >> >>$cc-cmd $patchfilename >> >> so, when you used 'cat cc-cmd' as the value of --cc-cmd, your invocation >> became: >> >>cat cc-cmd $patchfilename >> >> and sinc

Re: How to use --cc-cmd in git-send-email?

2015-07-19 Thread Philip Oakley
From: "Eric Sunshine" On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley wrote: I've been using git-send-email with repeated individual --cc="email address" parameters on the command line. I tried putting all the addresses, one per line, into a file 'cc-cmd', so I could use if for the --cc-cmd

[PATCH v2 3/5] Documentation/config: fix stale "git prune --worktree" reference

2015-07-19 Thread Eric Sunshine
From: Michael Haggerty This should have been changed to "git worktree prune" by df0b6cf (worktree: new place for "git prune --worktrees", 2015-06-29) [es: reword commit message] Signed-off-by: Michael Haggerty Signed-off-by: Eric Sunshine --- Documentation/config.txt | 2 +- 1 file changed,

[PATCH v2 5/5] config: rename "gc.pruneWorktreesExpire" to "gc.worktreePruneExpire"

2015-07-19 Thread Eric Sunshine
As of df0b6cf (worktree: new place for "git prune --worktrees", 2015-06-29), linked worktree pruning functionality moved from "git prune --worktrees" to "git worktree prune". Rename the associated configuration variable accordingly. Signed-off-by: Eric Sunshine --- I'm not convinced this is wort

[PATCH v2 4/5] Documentation/git-worktree: wordsmith worktree-related manpages

2015-07-19 Thread Eric Sunshine
From: Michael Haggerty [es: reword .git/worktrees and .git/worktrees//locked descriptions] Signed-off-by: Michael Haggerty Signed-off-by: Eric Sunshine --- Documentation/config.txt | 8 Documentation/gitrepository-layout.txt | 16 2 files changed, 12 i

[PATCH v2 2/5] Documentation/git-worktree: fix incorrect reference to file "locked"

2015-07-19 Thread Eric Sunshine
From: Michael Haggerty The administrative file to suppress pruning is named "locked", not "lock". [es: don't touch unrelated "git worktree lock" command; reword commit message] Signed-off-by: Michael Haggerty Signed-off-by: Eric Sunshine --- Documentation/git-worktree.txt | 2 +- 1 file chan

[PATCH v2 0/5] mh: worktree-related doc fixes

2015-07-19 Thread Eric Sunshine
This re-roll of Michael Haggerty's worktree-related documentation tweaks[1] takes my review comments into account and adds one new patch. A v1 to v2 interdiff is included below. Changes since v1: patch 1/5: fix additional instances of "worktree" -> "working tree" patch 2/5: don't rename "git wor

[PATCH v2 1/5] Documentation/git-worktree: consistently use term "linked working tree"

2015-07-19 Thread Eric Sunshine
From: Michael Haggerty Sometimes linked working trees were called "linked working directories" or "linked worktrees". Always refer to them as "linked working trees" for consistency. [es: fix additional occurrences] Signed-off-by: Michael Haggerty Signed-off-by: Eric Sunshine --- Documentatio

Re: [msysGit] [PATCH v2 10/16] engine.pl: delete the captured stderr file if empty

2015-07-19 Thread Eric Sunshine
On Sun, Jul 19, 2015 at 4:08 PM, Philip Oakley wrote: > Keep the build clean of extraneous files if it is indeed clean. > Otherwise leave the msvc-build-makedryerrors.txt file both as > a flag for any CI system or for manual debugging. > > Note that the file will contain the new values of the GIT_

Re: [msysGit] [PATCH v2 08/16] engine.pl: ignore invalidcontinue.obj which is known to MSVC

2015-07-19 Thread Eric Sunshine
On Sun, Jul 19, 2015 at 4:08 PM, Philip Oakley wrote: > Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better > POSIX compatibility, 2014-03-29) is not processed correctly > by the buildsystem. Ignore it. What does "not processed correctly" mean? For a person reading the commit message, bu

Re: [PATCH v3 4/9] ref-filter: add support to sort by version

2015-07-19 Thread Eric Sunshine
On Sat, Jul 18, 2015 at 3:12 PM, Karthik Nayak wrote: > Add support to sort by version using the "v:refname" and > "version:refname" option. This is achieved by using the > 'version_cmp()' function as the comparing function for qsort. To agree with the actual code: s/version_cmp/versioncmp/ > Th

Re: How to use --cc-cmd in git-send-email?

2015-07-19 Thread Eric Sunshine
On Sun, Jul 19, 2015 at 6:02 PM, Philip Oakley wrote: > I've been using git-send-email with repeated individual --cc="email address" > parameters on the command line. > > I tried putting all the addresses, one per line, into a file 'cc-cmd', so I > could use if for the --cc-cmd option. > > I then

git-subtree with log.date=relative

2015-07-19 Thread Bryan Jacobs
Dear git Developers, When setting log.date=relative in ~/.gitconfig, all "git subtree push" commands fail with errors like this: git push using: ../../repos/second master fatal: invalid date format: 8 minutes ago Can't copy commit 10827bbf18aa17108e07039d9c125000889a4365 I believe git subtree i

Re: [PATCH v3 3/9] ref-filter: support printing N lines from tag annotation

2015-07-19 Thread Eric Sunshine
On Sat, Jul 18, 2015 at 3:12 PM, Karthik Nayak wrote: > In 'tag.c' we can print N lines from the annotation of the tag using > the '-n' option. Copy code from 'tag.c' to 'ref-filter' and > modify 'ref-filter' to support printing of N lines from the annotation > of tags. > > Signed-off-by: Karthik

Re: [PATCH v3 1/9] ref-filter: add option to align atoms to the left

2015-07-19 Thread Eric Sunshine
On Sat, Jul 18, 2015 at 3:12 PM, Karthik Nayak wrote: > Add a new atom "align" and support %(align:X) where X is a number. > This will align the preceeding atom value to the left followed by > spaces for a total length of X characters. If X is less than the item > size, the entire atom value is pr

Re: Git tag: pre-receive hook issue

2015-07-19 Thread Jacob Keller
To check whether the ref being updated is a tag, you need to check the 3rd parameter. pre-receive receives in the format so you need to check each line's 3rd value which is the ref-name being updated. If it's in refs/tags then it's a tag update. If it's not, you can check it as a branch update

How to use --cc-cmd in git-send-email?

2015-07-19 Thread Philip Oakley
I've been using git-send-email with repeated individual --cc="email address" parameters on the command line. I tried putting all the addresses, one per line, into a file 'cc-cmd', so I could use if for the --cc-cmd option. I then tried to use --cc-cmd='cat cc-cmd' to do the send-email (as a

Re: [PATCH 1/3] Modify tr expressions so that xpg4/tr handles it on Solaris

2015-07-19 Thread Eric Sunshine
On Sun, Jul 19, 2015 at 2:00 PM, Ben Walton wrote: > It seems that xpg4/tr mishandles some strings involving [ not followed > by a character class: > % echo '[::1]' | /usr/xpg4/bin/tr -d '[]' > [::1 > > % echo '[::1]' | /usr/xpg4/bin/tr -d '[' > usr/xpg4/bin/tr: Bad string. > > This was breaking t

Re: [PATCH 3/3] Fix sed usage in tests to work around broken xpg4/sed on Solaris

2015-07-19 Thread Johannes Sixt
Am 19.07.2015 um 20:00 schrieb Ben Walton: - sed -e s/CHANGE_ME/change_me/ file+ && + perl -pne "s/CHANGE_ME/change_me/" file >file+ && Did you mean '-lpe' or better '-pe' here? -- Hannes -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to

Re: [PATCH v2 14/16] vcbuild/readme: Improve layout and reference msvc-build script

2015-07-19 Thread Philip Oakley
From: "Philip Oakley" Sent: Sunday, July 19, 2015 9:08 PM This "14/16" is the wrong version accidently left over from a previous draft. Please use the other version with the shorter subject line. Sorry for the noise / mistake. Layout the 'either/or' with more white space to clarify which al

[PATCH v2 14/16] vcbuild/readme: Improve layout

2015-07-19 Thread Philip Oakley
Layout the 'either/or' with more white space to clarify which alternatives are matched up. A revised copy of the Msysgit msvc-build script which automates this README is introduced in the next commit. Signed-off-by: Philip Oakley --- compat/vcbuild/README | 25 + 1 file

[PATCH v2 02/16] .gitignore: improve MSVC ignore patterns

2015-07-19 Thread Philip Oakley
Add the Microsoft .manifest pattern, and correct the generic 'Debug' and 'Release' directory patterns which were mechanically adjusted way back in c591d5f (gitignore: root most patterns at the top-level directory, 2009-10-26) to allow multi-level projects within the Git suite. Signed-off-by: Phili

[PATCH v2 15/16] msvc-build: add complete Microsoft Visual C compilation script

2015-07-19 Thread Philip Oakley
Implement the README to facilitate cross community development. Include comments for those Windows folks not yet fully familiar with bash commands. This is identical to the msysgit script, except for the 'cd toplevel' step, and comments for the edification of converts from Windows. Original autho

[PATCH v2 06/16] engine.pl: Properly accept quoted spaces in filenames

2015-07-19 Thread Philip Oakley
The engine.pl script barfs on the properly quoted spaces in filename options prevalent on Windows. Use shellwords() rather than split() to separate such options. Helped-by: Junio C Hamano Signed-off-by: Philip Oakley --- Junio's help at gmane.comp.version-control.msysgit/21145 (2014-11-21) & gma

[PATCH v2 08/16] engine.pl: ignore invalidcontinue.obj which is known to MSVC

2015-07-19 Thread Philip Oakley
Commit 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX compatibility, 2014-03-29) is not processed correctly by the buildsystem. Ignore it. Also split the .o and .obj processing; 'make' does not produce .obj files. Only substitute filenames ending with .o when generating the source .c

[PATCH v2 09/16] engine.pl: name the msvc buildsystem's makedry error file

2015-07-19 Thread Philip Oakley
Save the stderr from the dry MSVC make to a well named file for later review. Use 'msvc-build-makedryerrors.txt' which should be obvious as to its source, and is not ignored by 'git status'. Signed-off-by: Philip Oakley --- fixed false mode change:- Junio's report (last line of) http://marc.info/

[PATCH v2 10/16] engine.pl: delete the captured stderr file if empty

2015-07-19 Thread Philip Oakley
Keep the build clean of extraneous files if it is indeed clean. Otherwise leave the msvc-build-makedryerrors.txt file both as a flag for any CI system or for manual debugging. Note that the file will contain the new values of the GIT_VERSION and GITGUI_VERSION if they were generated by the make fi

[PATCH v2 07/16] engine.pl: Fix i18n -o option in msvc buildsystem generator

2015-07-19 Thread Philip Oakley
The i18n 5e9637c (i18n: add infrastructure for translating Git with gettext, 2011-11-18) introduced an extra '-o' option into the make file. If the msvc buildsystem is run without NO_GETTEXT being set then this broke the engine.pl code for extracting the git.sln for msvc gui-IDE. The setting of NO

[PATCH v2 12/16] engine.pl: provide more debug print statements

2015-07-19 Thread Philip Oakley
Assist developers transitioning between the two cultures by including appropriate, but commented out, debug statements. The exception is when an unhandled compiler option is detected, where printing of the full line will supplement the line number and option part. Otherwise the OP has no immediate

[PATCH v2 13/16] Vcproj.pm: list git.exe first to be startup project

2015-07-19 Thread Philip Oakley
Visual Studio takes the first listed application/library as the default startup project [1]. Detect the 'git' project and place it the head of the apps list, rather than the tail. Export the apps list before libs list for both the projects and global structures of the .sln file. [1] http://stack

[PATCH v2 14/16] vcbuild/readme: Improve layout and reference msvc-build script

2015-07-19 Thread Philip Oakley
Layout the 'either/or' with more white space to clarify which alternatives are matched up. Reference the Msysgit build script which automates one sequence of options. Signed-off-by: Philip Oakley --- compat/vcbuild/README | 27 +++ 1 file changed, 19 insertions(+), 8 del

[PATCH v2 16/16] config.mak.uname: add MSVC No_SafeExeceptionHandler option

2015-07-19 Thread Philip Oakley
Microsoft flipped the Windows Safe Exception Handling default in VS2013 so that zlib became unacceptable to certain OS versions (Vista and subsequent 32-bit OS's) without the addition of the option -SAFESEH:NO. Provide a switch to disable the Safe Exeption Handler when required. The option ImageH

[PATCH v2 11/16] engine.pl: add debug line to capture the dry-run

2015-07-19 Thread Philip Oakley
Add a debug suggestion for capturing to file the stdout from the dry-run of the make file used in determining the msvc-build structure for easy debugging. Signed-off-by: Philip Oakley --- contrib/buildsystems/engine.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/buildsystems/engi

[PATCH v2 03/16] .gitignore: ignore library directories created by MSVC VS2008 buildsystem

2015-07-19 Thread Philip Oakley
Signed-off-by: Philip Oakley --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 91e75ee..e35c492 100644 --- a/.gitignore +++ b/.gitignore @@ -178,6 +178,7 @@ /gitweb/gitweb.cgi /gitweb/static/gitweb.js /gitweb/static/gitweb.min.* +/libgit /test

[PATCH v2 04/16] (msvc-build) Vcproj.pm: remove duplicate GUID

2015-07-19 Thread Philip Oakley
Delete the duplicated GUID from the generation code for the Visual Studio .sln project file. The duplicate GUID tended to be allocated to test-svn-fe, which was then ignored by Visual Studio / MSVC, and its omission from the build never noticed. Signed-off-by: Philip Oakley --- Eric Sunshine cor

[PATCH v2 00/16] Make the msvc-build scripts work again

2015-07-19 Thread Philip Oakley
This updated series fixes the scripts which generated Visual Studio project files. The scripts had bit rotted over the years as other commits changed the git makefile which it post-processes. The series doesn't attempt (yet) to install the Visual Studio compiled product but allows Windows develope

[PATCH v2 01/16] perl/Makefile: treat a missing PM.stamp as if empty

2015-07-19 Thread Philip Oakley
'make clean', or a 'git clean -dfx' will delete the PM stamp file, so it cannot be a direct target in such clean conditions, resulting in an error. Normally the PM.stamp is recreated by the git/Makefile, except when a dry-run is requested, for example, as used in the msysgit msvc-build script whic

[PATCH v2 05/16] engine.pl: fix error message (lib->link)

2015-07-19 Thread Philip Oakley
Signed-off-by: Philip Oakley --- contrib/buildsystems/engine.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/buildsystems/engine.pl b/contrib/buildsystems/engine.pl index 23da787..c8a5258 100755 --- a/contrib/buildsystems/engine.pl +++ b/contrib/buildsystems/engine.

Re: [PATCH v3 9/9] tag.c: implement '--merged' and '--no-merged' options

2015-07-19 Thread Christian Couder
On Sun, Jul 19, 2015 at 12:00 AM, Karthik Nayak wrote: > From: Karthik Nayak > > Using 'ref-filter' APIs implement the '--merged' and '--no-merged' > options into 'tag.c'. The '--merged' option lets the user to only > list tags merged into the named commit. The '--no-merged' option > lets the use

[PATCH 3/3] Fix sed usage in tests to work around broken xpg4/sed on Solaris

2015-07-19 Thread Ben Walton
In 99094a7a, a trivial && breakage was fixed. This exposed a problem with the test when run on Solaris with xpg4/sed that had gone silently undetected since its introduction in e4bd10b2. Solaris' sed executes the requested substitution but prints a warning about the missing newline at the end of th

[PATCH 1/3] Modify tr expressions so that xpg4/tr handles it on Solaris

2015-07-19 Thread Ben Walton
It seems that xpg4/tr mishandles some strings involving [ not followed by a character class: % echo '[::1]' | /usr/xpg4/bin/tr -d '[]' [::1 % echo '[::1]' | /usr/xpg4/bin/tr -d '[' usr/xpg4/bin/tr: Bad string. This was breaking two tests. To fix the issue, use the octal representations of [ and ]

[PATCH 2/3] Fix sed usage in tests to work around broken xpg4/sed on Solaris

2015-07-19 Thread Ben Walton
The space following the last / in a sed command caused Solaris' xpg4/sed to fail, claiming the program was garbled and exit with status 2: % echo 'foo' | /usr/xpg4/bin/sed -e 's/foo/bar/ ' sed: command garbled: s/foo/bar/ % echo $? 2 Fix this by simply removing the unnecessary space. Signed-off-

Adapt some tests to work around broken Solaris tools

2015-07-19 Thread Ben Walton
This series is a respin of the previous submission, taking feedback into account. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH v6 26/45] builtin-am: implement --[no-]message-id, am.messageid

2015-07-19 Thread Paul Tan
Since a078f73 (git-am: add --message-id/--no-message-id, 2014-11-25), git-am.sh supported the --[no-]message-id options, and the "am.messageid" setting which specifies the default option. --[no-]message-id tells git-am whether or not the -m option should be passed to git-mailinfo. Re-implement th

[PATCH v6 39/45] builtin-am: support and auto-detect StGit patches

2015-07-19 Thread Paul Tan
Since c574e68 (git-am foreign patch support: StGIT support, 2009-05-27), git-am.sh supported converting StGit patches into RFC2822 mail patches that can be parsed with git-mailinfo. Implement this by introducing two functions in builtin/am.c: stgit_patch_to_mail() and split_mail_conv(). stgit_pat

[PATCH v6 32/45] builtin-am: implement -S/--gpg-sign, commit.gpgsign

2015-07-19 Thread Paul Tan
Since 3b4e395 (am: add the --gpg-sign option, 2014-02-01), git-am.sh supported the --gpg-sign option, and would pass it to git-commit-tree, thus GPG-signing the commit object. Re-implement this option in builtin/am.c. git-commit-tree would also sign the commit by default if the commit.gpgsign set

[PATCH v6 33/45] builtin-am: invoke post-rewrite hook

2015-07-19 Thread Paul Tan
Since 96e1948 (rebase: invoke post-rewrite hook, 2010-03-12), git-am.sh will invoke the post-rewrite hook after it successfully finishes applying all the queued patches. To do this, when parsing a mail to extract its patch and metadata, in --rebasing mode git-am.sh will also store the original com

[PATCH v6 40/45] builtin-am: support and auto-detect StGit series files

2015-07-19 Thread Paul Tan
Since c574e68 (git-am foreign patch support: StGIT support, 2009-05-27), git-am.sh is able to read a single StGit series file and, for each StGit patch listed in the file, convert the StGit patch into a RFC2822 mail patch suitable for parsing with git-mailinfo, and queue them in the state directory

[PATCH v6 09/45] builtin-am: implement committing applied patch

2015-07-19 Thread Paul Tan
Implement do_commit(), which commits the index which contains the results of applying the patch, along with the extracted commit message and authorship information. Since 29b6754 (am: remove rebase-apply directory before gc, 2010-02-22), git gc --auto is also invoked to pack the loose objects that

[PATCH v6 19/45] cache-tree: introduce write_index_as_tree()

2015-07-19 Thread Paul Tan
A caller may wish to write a temporary index as a tree. However, write_cache_as_tree() assumes that the index was read from, and will write to, the default index file path. Introduce write_index_as_tree() which removes this limitation by allowing the caller to specify its own index_state and index

[PATCH v6 36/45] builtin-am: invoke pre-applypatch hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sg will invoke the pre-applypatch hook after applying the patch to the index, but before a commit is made. Should the hook exit with a non-zero status, git am will exit. Re-implement this in builtin/am.c. Signed-off-by: Paul T

[PATCH v6 42/45] builtin-am: implement -i/--interactive

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh supported the --interactive mode. After parsing the patch mail and extracting the patch, commit message and authorship info, an interactive session will begin that allows the user to choose between: * applying the patch * a

[PATCH v6 37/45] builtin-am: invoke post-applypatch hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh will invoke the post-applypatch hook after the patch is applied and a commit is made. The exit code of the hook is ignored. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 2 ++ 1 file change

[PATCH v6 31/45] builtin-am: implement --committer-date-is-author-date

2015-07-19 Thread Paul Tan
Since 3f01ad6 (am: Add --committer-date-is-author-date option, 2009-01-22), git-am.sh implemented the --committer-date-is-author-date option, which tells git-am to use the timestamp recorded in the email message as both author and committer date. Re-implement this option in builtin/am.c. Signed-o

[PATCH v6 35/45] builtin-am: invoke applypatch-msg hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh will invoke the applypatch-msg hooks just after extracting the patch message. If the applypatch-msg hook exits with a non-zero status, git-am.sh abort before even applying the patch to the index. Re-implement this in builtin

[PATCH v6 43/45] builtin-am: implement legacy -b/--binary option

2015-07-19 Thread Paul Tan
The -b/--binary option was initially implemented in 087b674 (git-am: --binary; document --resume and --binary., 2005-11-16). The option will pass the --binary flag to git-apply to allow it to apply binary patches. However, in 2b6eef9 (Make apply --binary a no-op., 2006-09-06), --binary was been ma

[PATCH v6 44/45] builtin-am: check for valid committer ident

2015-07-19 Thread Paul Tan
When commit_tree() is called, if the user does not have an explicit committer ident configured, it will attempt to construct a default committer ident based on the user's and system's info (e.g. gecos field, hostname etc.) However, if a default committer ident is unable to be constructed, commit_tr

[PATCH v6 45/45] builtin-am: remove redirection to git-am.sh

2015-07-19 Thread Paul Tan
At the beginning of the rewrite of git-am.sh to C, in order to not break existing test scripts that depended on a functional git-am, a redirection to git-am.sh was introduced that would activate if the environment variable _GIT_USE_BUILTIN_AM was not defined. Now that all of git-am.sh's functional

[PATCH v6 25/45] builtin-am: implement -k/--keep, --keep-non-patch

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh supported the -k/--keep option to pass the -k option to git-mailsplit. Since f7e5ea1 (am: learn passing -b to mailinfo, 2012-01-16), git-am.sh supported the --keep-non-patch option to pass the -b option to git-mailsplit. Re

[PATCH v6 41/45] builtin-am: support and auto-detect mercurial patches

2015-07-19 Thread Paul Tan
Since 0cfd112 (am: preliminary support for hg patches, 2011-08-29), git-am.sh could convert mercurial patches to an RFC2822 mail patch suitable for parsing with git-mailinfo, and queue them in the state directory for application. Since 15ced75 (git-am foreign patch support: autodetect some patch f

[PATCH v6 38/45] builtin-am: rerere support

2015-07-19 Thread Paul Tan
git-am.sh will call git-rerere at the following events: * "git rerere" when a three-way merge fails to record the conflicted automerge results. Since 8389b52 (git-rerere: reuse recorded resolve., 2006-01-28) * Since cb6020b (Teach --[no-]rerere-autoupdate option to merge, revert and fri

[PATCH v6 34/45] builtin-am: support automatic notes copying

2015-07-19 Thread Paul Tan
Since eb2151b (rebase: support automatic notes copying, 2010-03-12), git-am.sh supported automatic notes copying in --rebasing mode by invoking "git notes copy" once it has finished applying all the patches. Re-implement this feature in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 6

[PATCH v6 23/45] builtin-am: handle stray state directory

2015-07-19 Thread Paul Tan
Should git-am terminate unexpectedly between the point where the state directory is created, but the "next" and "last" files are not written yet, a stray state directory will be left behind. As such, since b141f3c (am: handle stray $dotest directory, 2013-06-15), git-am.sh explicitly recognizes su

[PATCH v6 27/45] builtin-am: support --keep-cr, am.keepcr

2015-07-19 Thread Paul Tan
Since ad2c928 (git-am: Add command line parameter `--keep-cr` passing it to git-mailsplit, 2010-02-27), git-am.sh supported the --keep-cr option and would pass it to git-mailsplit. Since e80d4cb (git-am: Add am.keepcr and --no-keep-cr to override it, 2010-02-27), git-am.sh supported the am.keepcr

[PATCH v6 28/45] builtin-am: implement --[no-]scissors

2015-07-19 Thread Paul Tan
Since 017678b (am/mailinfo: Disable scissors processing by default, 2009-08-26), git-am supported the --[no-]scissors option, passing it to git-mailinfo. Re-implement support for this option in builtin/am.c. Since the default setting of --scissors in git-mailinfo can be configured with mailinfo.s

[PATCH v6 29/45] builtin-am: pass git-apply's options to git-apply

2015-07-19 Thread Paul Tan
git-am.sh recognizes some of git-apply's options, and would pass them to git-apply: * --whitespace, since 8c31cb8 (git-am: --whitespace=x option., 2006-02-28) * -C, since 67dad68 (add -C[NUM] to git-am, 2007-02-08) * -p, since 2092a1f (Teach git-am to pass -p option down to git-apply, 2007-0

[PATCH v6 30/45] builtin-am: implement --ignore-date

2015-07-19 Thread Paul Tan
Since a79ec62 (git-am: Add --ignore-date option, 2009-01-24), git-am.sh supported the --ignore-date option, and would use the current timestamp instead of the one provided in the patch if the option was set. Re-implement this option in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 6

[PATCH v6 12/45] builtin-am: don't parse mail when resuming

2015-07-19 Thread Paul Tan
Since 271440e (git-am: make it easier after fixing up an unapplicable patch., 2005-10-25), when "git am" is run again after being paused, the current mail message will not be re-parsed, but instead the contents of the state directory's patch, msg and author-script files will be used as-is instead.

[PATCH v6 10/45] builtin-am: refuse to apply patches if index is dirty

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am will refuse to apply patches if the index is dirty. Re-implement this behavior in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 45 + 1 file changed, 45 insertions(+) di

[PATCH v6 20/45] builtin-am: implement --3way, am.threeWay

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh supported the --3way option, and if set, would attempt to do a 3-way merge if the initial patch application fails. Since d96a275 (git-am: add am.threeWay config variable, 2015-06-04), the setting am.threeWay configures if th

[PATCH v6 24/45] builtin-am: implement -u/--utf8

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh supported the -u,--utf8 option. If set, the -u option will be passed to git-mailinfo to re-code the commit log message and authorship in the charset specified by i18n.commitencoding. If unset, the -n option will be passed to

[PATCH v6 14/45] builtin-am: implement --abort

2015-07-19 Thread Paul Tan
Since 3e5057a (git am --abort, 2008-07-16), git-am supported the --abort option that will rewind HEAD back to the original commit. Re-implement this through am_abort(). Since 7b3b7e3 (am --abort: keep unrelated commits since the last failure and warn, 2010-12-21), to prevent commits made since the

[PATCH v6 16/45] builtin-am: implement -q/--quiet

2015-07-19 Thread Paul Tan
Since 0e987a1 (am, rebase: teach quiet option, 2009-06-16), git-am supported the --quiet option, and when told to be quiet, would only speak on failure. Re-implement this by introducing the say() function, which works like fprintf_ln(), but would only write to the stream when state->quiet is false.

[PATCH v6 15/45] builtin-am: reject patches when there's a session in progress

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am would error out if the user gave it mbox(s) on the command-line, but there was a session in progress. Since c95b138 (Fix git-am safety checks, 2006-09-15), git-am would detect if the user attempted to feed it a mbox via stdin,

[PATCH v6 18/45] builtin-am: implement -s/--signoff

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am supported the --signoff option which will append a signoff at the end of the commit messsage. Re-implement this feature in parse_mail() by calling append_signoff() if the option is set. Signed-off-by: Paul Tan --- builtin/am.

[PATCH v6 21/45] builtin-am: implement --rebasing mode

2015-07-19 Thread Paul Tan
Since 3041c32 (am: --rebasing, 2008-03-04), git-am.sh supported the --rebasing option, which is used internally by git-rebase to tell git-am that it is being used for its purpose. It would create the empty file $state_dir/rebasing to help "completion" scripts tell if the ongoing operation is am or

[PATCH v6 13/45] builtin-am: implement --skip

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am supported resuming from a failed patch application by skipping the current patch. Re-implement this feature by introducing am_skip(). Helped-by: Stefan Beller Signed-off-by: Paul Tan --- Notes: v6 * Moved lock_f

[PATCH v6 17/45] builtin-am: exit with user friendly message on failure

2015-07-19 Thread Paul Tan
Since ced9456 (Give the user a hint for how to continue in the case that git-am fails because it requires user intervention, 2006-05-02), git-am prints additional information on how the user can re-invoke git-am to resume patch application after resolving the failure. Re-implement this through the

[PATCH v6 11/45] builtin-am: implement --resolved/--continue

2015-07-19 Thread Paul Tan
Since 0c15cc9 (git-am: --resolved., 2005-11-16), git-am supported resuming from a failed patch application. The user will manually apply the patch, and the run git am --resolved which will then commit the resulting index. Re-implement this feature by introducing am_resolve(). Since it makes no sen

[PATCH v6 22/45] builtin-am: bypass git-mailinfo when --rebasing

2015-07-19 Thread Paul Tan
Since 5e835ca (rebase: do not munge commit log message, 2008-04-16), git am --rebasing no longer gets the commit log message from the patch, but reads it directly from the commit identified by the "From " header line. Since 43c2325 (am: use get_author_ident_from_commit instead of mailinfo when reb

[PATCH v6 08/45] builtin-am: apply patch with git-apply

2015-07-19 Thread Paul Tan
Implement applying the patch to the index using git-apply. If a file is unchanged but stat-dirty, git-apply may erroneously fail to apply patches, thinking that they conflict with a dirty working tree. As such, since 2a6f08a (am: refresh the index at start and --resolved, 2011-08-15), git-am will

[PATCH v6 03/45] builtin-am: implement skeletal builtin am

2015-07-19 Thread Paul Tan
For the purpose of rewriting git-am.sh into a C builtin, implement a skeletal builtin/am.c that redirects to $GIT_EXEC_PATH/git-am if the environment variable _GIT_USE_BUILTIN_AM is not defined. Since in the Makefile git-am.sh takes precedence over builtin/am.c, $GIT_EXEC_PATH/git-am will contain t

[PATCH v6 05/45] builtin-am: split out mbox/maildir patches with git-mailsplit

2015-07-19 Thread Paul Tan
git-am.sh supports mbox, stgit and mercurial patches. Re-implement support for splitting out mbox/maildirs using git-mailsplit, while also implementing the framework required to support other patch formats in the future. Re-implement support for the --patch-format option (since a5a6755 (git-am for

[PATCH v6 06/45] builtin-am: auto-detect mbox patches

2015-07-19 Thread Paul Tan
Since 15ced75 (git-am foreign patch support: autodetect some patch formats, 2009-05-27), git-am.sh is able to autodetect mbox, stgit and mercurial patches through heuristics. Re-implement support for autodetecting mbox/maildir files in builtin/am.c. RFC 2822 requires that lines are terminated by

[PATCH v6 07/45] builtin-am: extract patch and commit info with git-mailinfo

2015-07-19 Thread Paul Tan
For the purpose of applying the patch and committing the results, implement extracting the patch data, commit message and authorship from an e-mail message using git-mailinfo. git-mailinfo is run as a separate process, but ideally in the future, we should be be able to access its functionality dir

[PATCH v6 02/45] wrapper: implement xfopen()

2015-07-19 Thread Paul Tan
A common usage pattern of fopen() is to check if it succeeded, and die() if it failed: FILE *fp = fopen(path, "w"); if (!fp) die_errno(_("could not open '%s' for writing"), path); Implement a wrapper function xfopen() for the above, so that we can save a few lines

[PATCH v6 01/45] wrapper: implement xopen()

2015-07-19 Thread Paul Tan
A common usage pattern of open() is to check if it was successful, and die() if it was not: int fd = open(path, O_WRONLY | O_CREAT, 0777); if (fd < 0) die_errno(_("Could not open '%s' for writing."), path); Implement a wrapper function xopen() that does the above s

[PATCH v6 04/45] builtin-am: implement patch queue mechanism

2015-07-19 Thread Paul Tan
git-am applies a series of patches. If the process terminates abnormally, we want to be able to resume applying the series of patches. This requires the session state to be saved in a persistent location. Implement the mechanism of a "patch queue", represented by 2 integers -- the index of the cur

[PATCH v6 00/45] Make git-am a builtin

2015-07-19 Thread Paul Tan
This patch series depends on pt/pull-builtin. This is a re-roll of [v5]. The changes are as follows: * Compacted the struct am_state declaration, so there are no ugly newlines between every field. * Removed unnecessary assert()s. * Simplified "if (x) free(x)" to just free(x) * Only alloc mem

[PATCH v3 09/12] t4150: am with post-applypatch hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh will invoke the post-applypatch hook after the patch is applied and a commit is made. The exit code of the hook is ignored. Add tests for this hook. Helped-by: Junio C Hamano Reviewed-by: Stefan Beller Reviewed-by: Johann

[PATCH v3 11/12] t3418: non-interactive rebase --continue with rerere enabled

2015-07-19 Thread Paul Tan
Since 8389b52 (git-rerere: reuse recorded resolve., 2006-01-28), git-am will call git-rerere to re-use recorded merge conflict resolutions if any occur in a threeway merge. Add a test to ensure that git-rerere is called by git-am (which handles the non-interactive rebase). Reviewed-by: Stefan Bel

[PATCH v3 10/12] t4150: tests for am --[no-]scissors

2015-07-19 Thread Paul Tan
Since 017678b (am/mailinfo: Disable scissors processing by default, 2009-08-26), git-am supported the --[no-]scissors option, passing it to git-mailinfo. Add tests to ensure that git-am will pass the --scissors option to git-mailinfo, and that --no-scissors will override the configuration setting

[PATCH v3 12/12] t3901: test git-am encoding conversion

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am supported the --utf8 and --no-utf8 options, and if set, would pass the -u flag and the -k flag respectively. git mailinfo -u will re-code the commit log message and authorship info in the charset specified by i18n.commitencodin

[PATCH v3 02/12] t4150: am fails if index is dirty

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am will ensure that the index is clean before applying the patch. This is to prevent changes unrelated to the patch from being committed. Add a test for this check. Reviewed-by: Stefan Beller Reviewed-by: Johannes Schindelin Si

[PATCH v3 07/12] t4150: am with applypatch-msg hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am will invoke the applypatch-msg hooks just after extracting the patch message. If the applypatch-msg hook exits with a non-zero status, git-am abort before even applying the patch to the index. Add tests for this hook. Helped-b

[PATCH v3 01/12] t4150: am.messageid really adds the message id

2015-07-19 Thread Paul Tan
Since a078f73 (git-am: add --message-id/--no-message-id, 2014-11-25), the am.messageid setting determines whether the --message-id option is set by default. Add a test for this. Reviewed-by: Paolo Bonzini Signed-off-by: Paul Tan --- t/t4150-am.sh | 12 1 file changed, 12 insertion

  1   2   >