Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-04 Thread Patrick Steinhardt
On Tue, Aug 04, 2015 at 06:42:46PM -0400, Jeff King wrote: > On Tue, Aug 04, 2015 at 09:31:18AM +0200, Sebastian Schuberth wrote: [snip] > Sadly we cannot just `strip_suffix_mem(repo, &len, "/.git"))` in the > earlier code, as we have to account for multiple directory separators. I > believe the ab

Re: [PATCH] git-p4: fix faulty paths for case insensitive systems

2015-08-04 Thread Lars Schneider
Thank you for your reply. Your t8919 test case looks exactly like the right thing. Unfortuantly I don’t have Internet access for the next two weeks. Afterwards I will provide a proper test cases for the patch. You are correct about the speed. All these initial “p4 dirs” calls make the clone pre

Re: [PATCH 2/4] submodule: implement `module_name` as a builtin helper

2015-08-04 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 8:04 PM, Stefan Beller wrote: > The goal of this series being rewriting `git submodule update`, > we don't want to call out to the shell script for config lookups. > > So reimplement the lookup of the submodule name in C. > > Signed-off-by: Stefan Beller > --- > diff --git

Re: [PATCH 2/4] submodule: implement `module_name` as a builtin helper

2015-08-04 Thread Stefan Beller
The series consists of 2 patches only actually. The next patches have not been sent as they are heavy WIP. -- 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 2/4] submodule: implement `module_name` as a builtin helper

2015-08-04 Thread Stefan Beller
The goal of this series being rewriting `git submodule update`, we don't want to call out to the shell script for config lookups. So reimplement the lookup of the submodule name in C. Signed-off-by: Stefan Beller --- When I started to implement git submodule add in the helper, I realized the

[PATCH 1/4] submodule: implement `module_list` as a builtin helper

2015-08-04 Thread Stefan Beller
Most of the submodule operations work on a set of submodules. Calculating and using this set is usually done via: module_list "$@" | { while read mode sha1 stage sm_path do # the actual operation done } Currently the function `module_

Re: fetching from an hg remote fails with bare git repositories

2015-08-04 Thread Mike Hommey
On Tue, Aug 04, 2015 at 05:27:13PM -0400, Taylor Braun-Jones wrote: > On Tue, Aug 4, 2015 at 2:56 PM, Stefan Beller wrote: > > On Tue, Aug 4, 2015 at 10:45 AM, Taylor Braun-Jones > > wrote: > >> Fetching from an hg remote fails with bare git repositories. Non-bare > >> repositories work fine. > >

Re: [PATCH v4] clone: simplify string handling in guess_dir_name()

2015-08-04 Thread Jeff King
On Tue, Aug 04, 2015 at 09:31:18AM +0200, Sebastian Schuberth wrote: > On Tue, Aug 4, 2015 at 6:34 AM, Lukas Fleischer wrote: > > > I am currently on vacation and cannot bisect or debug this but I am > > pretty confident that this patch changes the behaviour of directory name > > guessing. With

[PATCH v7 2/2] path: implement common_dir handling in git_path_submodule()

2015-08-04 Thread Max Kirillov
When submodule is a linked worktree, "git diff --submodule" and other calls which directly access the submodule's object database do not correctly calculate its path. Fix it by changing the git_path_submodule() behavior, to use either common or per-worktree directory. Do it similarly as for parent

Re: [PATCH] git-p4: fix faulty paths for case insensitive systems

2015-08-04 Thread Luke Diamand
On 02/08/15 16:15, larsxschnei...@gmail.com wrote: From: Lars Schneider Hi, I want to propose this patch as it helped us to migrate a big source code base successfully from P4 to Git. I am sorry that I don't provide a test case, yet. Case sensitivity is a pretty tricky area with p4 - it's ve

[PATCH v7 0/2] path: implement common_dir handling in git_path_submodule()

2015-08-04 Thread Max Kirillov
Emphasized that 1/2 does not change behavior. Max Kirillov (2): submodule refactor: use git_path_submodule() in add_submodule_odb() path: implement common_dir handling in git_path_submodule() cache.h | 1 + path.c | 24 -

[PATCH v7 1/2] submodule refactor: use git_path_submodule() in add_submodule_odb()

2015-08-04 Thread Max Kirillov
Functions which directly operate submodule's object database do not handle the case when the submodule is linked worktree (which are introduced in c7b3a3d2fe). Instead of fixing the path calculation use already existing git_path_submodule() function without changing overall behavior. Then it will b

[PATCH v6 1/2] submodule refactor: use git_path_submodule() in add_submodule_odb()

2015-08-04 Thread Max Kirillov
Functions which directly operate submodule's object database do not handle the case when the submodule is linked worktree (which are introduced in c7b3a3d2fe). Instead of fixing the path calculation use already existing git_path_submodule() function, with intention to modify only that function when

[PATCH v6 0/2] path: implement common_dir handling in git_path_submodule()

2015-08-04 Thread Max Kirillov
Fixed the pointer declaration spacing issue and updated commit messages. The 1/2 refactoring still might leave some cases behind. I could grep only function connect_work_tree_and_git_dir() which, as far as I can see, involved in moving repositories. Have not touched it because correct moving par

[PATCH v6 2/2] path: implement common_dir handling in git_path_submodule()

2015-08-04 Thread Max Kirillov
When submodule is a linked worktree, "git diff --submodule" and other calls which directly access the submodule's object database do not correctly calculate its path. Fix it by changing the git_path_submodule() behavior, to use either common or per-worktree directory. Do it similarly as for parent

Re: fetching from an hg remote fails with bare git repositories

2015-08-04 Thread Taylor Braun-Jones
On Tue, Aug 4, 2015 at 2:56 PM, Stefan Beller wrote: > On Tue, Aug 4, 2015 at 10:45 AM, Taylor Braun-Jones > wrote: >> Fetching from an hg remote fails with bare git repositories. Non-bare >> repositories work fine. >> >> Steps to reproduce: >> >> mkdir /tmp/hgrepo >> cd /tmp/hgrepo >> hg init >>

Re: [PATCH v2 0/3] am: let command-line options override saved options

2015-08-04 Thread Junio C Hamano
Paul Tan writes: > Let command-line options override saved options in git-am when resuming > > This is a re-roll of [v1]. Previous versions: > > [v1] http://thread.gmane.org/gmane.comp.version-control.git/274789 > > When resuming, git-am mistakenly ignores command-line options. > > For instance,

Re: [PATCH] git_open_noatime: return with errno=0 on success

2015-08-04 Thread Junio C Hamano
Clemens Buchacher writes: > diff --git a/sha1_file.c b/sha1_file.c > index 77cd81d..62b7ad6 100644 > --- a/sha1_file.c > +++ b/sha1_file.c > @@ -1453,6 +1453,7 @@ int git_open_noatime(const char *name) > static int sha1_file_open_flag = O_NOATIME; > > for (;;) { > + errn

Re: fetching from an hg remote fails with bare git repositories

2015-08-04 Thread Stefan Beller
On Tue, Aug 4, 2015 at 10:45 AM, Taylor Braun-Jones wrote: > Fetching from an hg remote fails with bare git repositories. Non-bare > repositories work fine. > > Steps to reproduce: > > mkdir /tmp/hgrepo > cd /tmp/hgrepo > hg init > echo foo > foo.txt > hg add foo.txt > hg commit -m "add foo.txt" f

Re: [PATCH v3 6/6] clone: add tests for cloning with empty path

2015-08-04 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 7:29 AM, Patrick Steinhardt wrote: > Test behavior of `git clone` when working with an empty path > component. This may be the case when cloning a file system's root > directory or from a remote server's root. A few minor, mostly style-related, comments below... > Signed-o

Re: [PATCH 1/2] Documentation/git-worktree: fix duplicated 'from'

2015-08-04 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 8:27 AM, Patrick Steinhardt wrote: > Signed-off-by: Patrick Steinhardt > --- > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > index 3387e2f..566ca92 100644 > --- a/Documentation/git-worktree.txt > +++ b/Documentation/git-worktree.txt > @@ -12

Re: [PATCH 2/2] Documentation/git-worktree: fix reference to 'locked' file

2015-08-04 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 8:27 AM, Patrick Steinhardt wrote: > The documentation of git-worktree refers to the 'locked' file as > 'lock'. Fix this to say 'locked' instead. Thanks for the patch. This is already fixed in 'next' by 2e73ab6 (Documentation/git-worktree: fix incorrect reference to file "l

fetching from an hg remote fails with bare git repositories

2015-08-04 Thread Taylor Braun-Jones
Fetching from an hg remote fails with bare git repositories. Non-bare repositories work fine. Steps to reproduce: mkdir /tmp/hgrepo cd /tmp/hgrepo hg init echo foo > foo.txt hg add foo.txt hg commit -m "add foo.txt" foo.txt git clone hg::/tmp/hgrepo/ /tmp/gitrepo cd /tmp/gitrepo/ git fetch # WORK

Pro Git - Missing Diagram Image

2015-08-04 Thread Robin Forder
Hi Git Community, In Pro Git, 1.1 Getting Started - About Version Control, an image is missing. It is the one for the centralized version control diagram. http://git-scm.com/book/en/v2/Getting-Started-About-Version-Control Yours, Robin. Robin Forder Senior Technical Author Technica

[PATCH v3] remote: add get-url subcommand

2015-08-04 Thread Ben Boeckel
Expanding `insteadOf` is a part of ls-remote --url and there is no way to expand `pushInsteadOf` as well. Add a get-url subcommand to be able to query both as well as a way to get all configured urls. Signed-off-by: Ben Boeckel --- Documentation/git-remote.txt | 10 builtin/remote.c

[PATCH] git-am: add am.threeWay config variable

2015-08-04 Thread Paul Tan
From: Remi Lespinet Add the am.threeWay configuration variable to use the -3 or --3way option of git am by default. When am.threeway is set and not desired for a specific git am command, the --no-3way option can be used to override it. Signed-off-by: Remi Lespinet Signed-off-by: Paul Tan --- I

[PATCH v2 0/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
Let command-line options override saved options in git-am when resuming This is a re-roll of [v1]. Previous versions: [v1] http://thread.gmane.org/gmane.comp.version-control.git/274789 When resuming, git-am mistakenly ignores command-line options. For instance, when a patch fails to apply with

[PATCH v2 3/3] am: let --signoff override --no-signoff

2015-08-04 Thread Paul Tan
After resolving a conflicting patch, a user may wish to sign off the patch to declare that the patch has been modified. As such, the user will expect that running "git am --signoff --continue" will append the signoff to the commit message. However, the --signoff option is only taken into account d

[PATCH v2 1/3] test_terminal: redirect child process' stdin to a pty

2015-08-04 Thread Paul Tan
When resuming, git-am detects if we are trying to feed it patches or not by checking if stdin is a TTY. However, the test library redirects stdin to /dev/null. This makes it difficult, for instance, to test the behavior of "git am -3" when resuming, as git-am will think we are trying to feed it pa

[PATCH v2 2/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
When resuming, git-am mistakenly ignores command-line options. For instance, when a patch fails to apply with "git am patch", subsequently running "git am --3way" would not cause git-am to fall back on attempting a threeway merge. This occurs because by default the --3way option is saved as "fals

[PATCH v2 0/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
Let command-line options override saved options in git-am when resuming This is a re-roll of [v1]. Previous versions: [v1] http://thread.gmane.org/gmane.comp.version-control.git/274789 When resuming, git-am mistakenly ignores command-line options. For instance, when a patch fails to apply with

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

2015-08-04 Thread Paul Tan
This is a re-roll of [v6]. The changes are as follows: * removed am.threeWay config to match master * renamed am_state's "append_signoff" field to the shorter "signoff" to preserve horizontal space. * Fix memory leak in am_abort() (Noticed by Stefan, thanks!) * Rebase onto master, and adjust

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

2015-08-04 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 v7 04/45] builtin-am: implement patch queue mechanism

2015-08-04 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 v7 25/45] builtin-am: implement -k/--keep, --keep-non-patch

2015-08-04 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 v7 09/45] builtin-am: implement committing applied patch

2015-08-04 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 v7 43/45] builtin-am: implement legacy -b/--binary option

2015-08-04 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 v7 11/45] builtin-am: implement --resolved/--continue

2015-08-04 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 v7 41/45] builtin-am: support and auto-detect mercurial patches

2015-08-04 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 v7 44/45] builtin-am: check for valid committer ident

2015-08-04 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 v7 29/45] builtin-am: pass git-apply's options to git-apply

2015-08-04 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 v7 42/45] builtin-am: implement -i/--interactive

2015-08-04 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 v7 34/45] builtin-am: support automatic notes copying

2015-08-04 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 v7 30/45] builtin-am: implement --ignore-date

2015-08-04 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 v7 19/45] cache-tree: introduce write_index_as_tree()

2015-08-04 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 v7 39/45] builtin-am: support and auto-detect StGit patches

2015-08-04 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 v7 37/45] builtin-am: invoke post-applypatch hook

2015-08-04 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 v7 36/45] builtin-am: invoke pre-applypatch hook

2015-08-04 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 v7 23/45] builtin-am: handle stray state directory

2015-08-04 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 v7 22/45] builtin-am: bypass git-mailinfo when --rebasing

2015-08-04 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 v7 33/45] builtin-am: invoke post-rewrite hook

2015-08-04 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 v7 20/45] builtin-am: implement --3way

2015-08-04 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 5d86861 (am -3: list the paths that needed 3-way fallback, 2012-03-28), in a 3-way merge git-am.sh woul

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

2015-08-04 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 v7 24/45] builtin-am: implement -u/--utf8

2015-08-04 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 v7 15/45] builtin-am: reject patches when there's a session in progress

2015-08-04 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 v7 35/45] builtin-am: invoke applypatch-msg hook

2015-08-04 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 v7 26/45] builtin-am: implement --[no-]message-id, am.messageid

2015-08-04 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 v7 31/45] builtin-am: implement --committer-date-is-author-date

2015-08-04 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 v7 18/45] builtin-am: implement -s/--signoff

2015-08-04 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 --- Notes:

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

2015-08-04 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 v7 17/45] builtin-am: exit with user friendly message on failure

2015-08-04 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 v7 07/45] builtin-am: extract patch and commit info with git-mailinfo

2015-08-04 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 v7 28/45] builtin-am: implement --[no-]scissors

2015-08-04 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 v7 32/45] builtin-am: implement -S/--gpg-sign, commit.gpgsign

2015-08-04 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 v7 27/45] builtin-am: support --keep-cr, am.keepcr

2015-08-04 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 v7 21/45] builtin-am: implement --rebasing mode

2015-08-04 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 v7 38/45] builtin-am: rerere support

2015-08-04 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 v7 40/45] builtin-am: support and auto-detect StGit series files

2015-08-04 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 v7 16/45] builtin-am: implement -q/--quiet

2015-08-04 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 v7 13/45] builtin-am: implement --skip

2015-08-04 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 --- builtin/am.c | 123 ++

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

2015-08-04 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 v7 02/45] wrapper: implement xfopen()

2015-08-04 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 v7 08/45] builtin-am: apply patch with git-apply

2015-08-04 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 v7 06/45] builtin-am: auto-detect mbox patches

2015-08-04 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 v7 05/45] builtin-am: split out mbox/maildir patches with git-mailsplit

2015-08-04 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 v7 10/45] builtin-am: refuse to apply patches if index is dirty

2015-08-04 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 v7 01/45] wrapper: implement xopen()

2015-08-04 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

Re: [PATCH 0/10] Port branch.c to ref-filter.

2015-08-04 Thread Karthik Nayak
There are nine patches in the series. Have put "0/10" by mistake. -- Regards, Karthik Nayak -- 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 01/10] ref-filter: add option to filter only branches

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Add an option in 'filter_refs()' to use 'for_each_branch_ref()' and filter refs. This type checking is done by adding a 'FILTER_REFS_BRANCHES' in 'ref-filter.h'. Add an option in 'ref_filter_handler()' to filter different types of branches by calling 'filter_branch_kind()' wh

[PATCH 08/10] branch.c: use 'ref-filter' APIs

2015-08-04 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with calls to the 'ref-filter' library. Make 'branch.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out tags based on the options set. We

[PATCH 02/10] branch: refactor width computation

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Remove unnecessary variables from ref_list and ref_item which were used for width computation. This is to make ref_item similar to ref-filter's ref_array_item. This will ensure a smooth port of branch.c to use ref-filter APIs in further patches. Previously the maxwidth was co

[PATCH 06/10] branch: drop non-commit error reporting

2015-08-04 Thread Karthik Nayak
Remove the error reporting variable to make the code easier to port over to using ref-filter APIs. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 18 -- 1 file changed, 4 insertions(+), 1

[PATCH 0/10] Port branch.c to ref-filter.

2015-08-04 Thread Karthik Nayak
This is part of my GSoC project to unify git tag -l, git branch -l, git for-each-ref. This patch series is continued from: Git (next) https://github.com/git/git/commit/bf5418f49ff0cebc6e5ce04ad1417e1a47c81b61 This series consists of porting branch.c over to using the ref-filter APIs. This does no

[PATCH 04/10] branch: roll show_detached HEAD into regular ref_list

2015-08-04 Thread Karthik Nayak
Remove show_detached() and make detached HEAD to be rolled into regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and supporting the same in append_ref(). This eliminates the need for an extra function and helps in easier porting of branch.c to use ref-filter APIs. Before show_detac

[PATCH 09/10] branch: add '--points-at' option

2015-08-04 Thread Karthik Nayak
Add the '--points-at' option provided by 'ref-filter'. The option lets the user to list only branches which points at the given object. Add documentation and tests for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- Documentation/git-branch.t

[PATCH 03/10] branch: bump get_head_description() to the top

2015-08-04 Thread Karthik Nayak
This is a preperatory patch for 'roll show_detached HEAD into regular ref_list'. This patch moves get_head_descrition() to the top so that it can be used in print_ref_item(). Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak ---

[PATCH 05/10] branch: move 'current' check down to the presentation layer

2015-08-04 Thread Karthik Nayak
We check if given ref is the current branch in print_ref_list(). Move this check to print_ref_item() where it is checked right before printing. Based-on-patch-by: Jeff King Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- builtin/branch.c | 22 +

[PATCH 07/10] branch.c: use 'ref-filter' data structures

2015-08-04 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'branch.c' to use 'ref-filter' APIs. This is a temporary step before porting 'branch.c' to use 'ref-filter' completely. As this is a temporary step, most o

[PATCH v9 05/11] ref-filter: support printing N lines from tag annotation

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak 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. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-of

[PATCH v9 02/11] ref-filter: introduce ref_formatting_state

2015-08-04 Thread Karthik Nayak
Introduce a ref_formatting_state which will eventually hold the values of modifier atoms. Implement this within ref-filter. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 64 +--- r

[PATCH v9 10/11] tag.c: implement '--format' option

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by

[PATCH v9 08/11] tag.c: use 'ref-filter' data structures

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'tag.c' to use 'ref-filter' APIs. This is a temporary step before porting 'tag.c' to use 'ref-filter' completely. As this is a temporary

[PATCH v9 06/11] ref-filter: add support to sort by version

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Add support to sort by version using the "v:refname" and "version:refname" option. This is achieved by using the 'versioncmp()' function as the comparing function for qsort. This option is included to support sorting by versions in `git tag -l` which will eventaully be ported

[PATCH v9 07/11] ref-filter: add option to match literal pattern

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak 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 like `git tag -l foo*` which would match

[PATCH v9 11/11] tag.c: implement '--merged' and '--no-merged' options

2015-08-04 Thread Karthik Nayak
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 user to only list tags not merged into the named commit. If no object

[PATCH v9 04/11] ref-filter: add option to filter only tags

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Add a functions called 'for_each_tag_ref_fullpath()' to refs.{c,h} which iterates through each tag ref without trimming the path. Add an option in 'filter_refs()' to use 'for_each_tag_ref_fullpath()' and filter refs. This type checking is done by adding a 'FILTER_REFS_TAGS' i

[PATCH v9 03/11] ref-filter: implement an `align` atom

2015-08-04 Thread Karthik Nayak
Implement an `align` atom which will act as a modifier atom and align any string with or without an %(atom) appearing before a %(end) atom to the right, left or middle. It is followed by `:,`, where the `` is either left, right or middle and `` is the total length of the padding to be performed. I

[PATCH v9 09/11] tag.c: use 'ref-filter' APIs

2015-08-04 Thread Karthik Nayak
From: Karthik Nayak Make 'tag.c' use 'ref-filter' APIs for iterating through refs, sorting and printing of refs. This removes most of the code used in 'tag.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out

[PATCH v9 01/11] ref-filter: print output to strbuf for formatting

2015-08-04 Thread Karthik Nayak
Introduce a strbuf `output` which will act as a substitute rather than printing directly to stdout. This will be used for formatting eventually. Mentored-by: Christian Couder Mentored-by: Matthieu Moy Signed-off-by: Karthik Nayak --- ref-filter.c | 36 ++-- 1 fi

[PATCH v9 0/11] Port tag.c over to use ref-filter APIs

2015-08-04 Thread Karthik Nayak
This is part of my GSoC project to unify git tag -l, git branch -l, git for-each-ref. This patch series is continued from: Git (next) https://github.com/git/git/commit/bf5418f49ff0cebc6e5ce04ad1417e1a47c81b61 This series consists of porting tag.c over to using the ref-filter APIs Version 8 can b

  1   2   >