summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-06-01builtin/apply: move 'apply_with_reject' global into 'struct apply_state'Libravatar Christian Couder1-7/+7
To libify the apply functionality the 'apply_with_reject' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01builtin/apply: move 'apply_in_reverse' global into 'struct apply_state'Libravatar Christian Couder1-19/+31
To libify the apply functionality the 'apply_in_reverse' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01builtin/apply: move 'check_index' global into 'struct apply_state'Libravatar Christian Couder1-29/+37
To libify the apply functionality the 'check_index' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01builtin/apply: move 'check' global into 'struct apply_state'Libravatar Christian Couder1-7/+7
To libify the apply functionality the 'check' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01builtin/apply: move 'unidiff_zero' global into 'struct apply_state'Libravatar Christian Couder1-18/+25
To libify the apply functionality the 'unidiff_zero' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-01builtin/apply: move 'state' init into init_apply_state()Libravatar Christian Couder1-10/+22
When the apply functionality will be libified, the 'struct apply_state' will be used by different pieces of code. To properly initialize a 'struct apply_state', let's provide a nice and easy to use init_apply_state() function. Let's also provide clear_apply_state() to release memory used by 'struct apply_state' members, so that a 'struct apply_state' instance can be easily reused without leaking memory. Note that clear_apply_state() does nothing for now, but it will later. While at it, let's rename 'prefix_' parameter to 'prefix'. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: introduce 'struct apply_state' to start libifyingLibravatar Christian Couder1-38/+56
Currently commands that want to use the apply functionality have to launch a "git apply" process which can be bad for performance. Let's start libifying the apply functionality and to do that we first need to get rid of the global variables in "builtin/apply.c". This patch introduces "struct apply_state" into which all the previously global variables will be moved. A new parameter called "state" that is a pointer to the "apply_state" structure will come at the beginning of the helper functions that need it and will be passed around the call chain. To start let's move the "prefix" and "prefix_length" global variables into "struct apply_state". Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: move 'read_stdin' global into cmd_apply()Libravatar Christian Couder1-1/+1
The 'read_stdin' variable doesn't need to be static and global to the file. It can be local to cmd_apply(), so let's move it there. This will make it easier to libify the apply functionality. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: move 'options' variable into cmd_apply()Libravatar Christian Couder1-1/+1
The 'options' variable doesn't need to be static and global to the file. It can be local to cmd_apply(), so let's move it there. This will make it easier to libify the apply functionality. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: extract line_by_line_fuzzy_match() from match_fragment()Libravatar Christian Couder1-55/+71
The match_fragment() function is very big and contains a big special case algorithm that does line by line fuzzy matching. So let's extract this algorithm in a separate line_by_line_fuzzy_match() function. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: avoid local variable shadowing 'len' parameterLibravatar Christian Couder1-10/+10
This is just a cleanup to avoid errors when compiling with -Wshadow and to make it safer to later move global variables into a "state" struct. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: avoid parameter shadowing 'linenr' globalLibravatar Christian Couder1-24/+24
Let's just rename the global 'state_linenr' as it will become 'state->linenr' in a following patch. This also avoid errors when compiling with -Wshadow and makes it safer to later move global variables into a "state" struct. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: avoid parameter shadowing 'p_value' globalLibravatar Christian Couder1-17/+17
Let's just rename the global 'state_p_value' as it will become 'state->p_value' in a following patch. This also avoid errors when compiling with -Wshadow and makes it safer to later move global variables into a "state" struct. Helped-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-12builtin/apply: make gitdiff_verify_name() return voidLibravatar Christian Couder1-13/+13
As the value returned by gitdiff_verify_name() is put into the same variable that is passed as a parameter to this function, it is simpler to pass the address of the variable and have gitdiff_verify_name() change the variable itself. This also makes it possible to later have this function return -1 instead of die()ing in case of error. Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-10Eleventh batch for 2.9Libravatar Junio C Hamano1-0/+21
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-10Merge branch 'svn/bad-ref' of git://bogomips.org/git-svnLibravatar Junio C Hamano1-1/+2
* 'svn/bad-ref' of git://bogomips.org/git-svn: Git/SVN: die when there is no commit metadata
2016-05-10Merge branch 'sk/gitweb-highlight-encoding'Libravatar Junio C Hamano1-0/+3
Some multi-byte encoding can have a backslash byte as a later part of one letter, which would confuse "highlight" filter used in gitweb. * sk/gitweb-highlight-encoding: gitweb: apply fallback encoding before highlight
2016-05-10Merge branch 'sb/clean-test-fix'Libravatar Junio C Hamano1-1/+1
* sb/clean-test-fix: t7300: mark test with SANITY
2016-05-10Merge branch 'rn/glossary-typofix'Libravatar Junio C Hamano1-1/+1
* rn/glossary-typofix: Documentation: fix typo 'In such these cases'
2016-05-10Merge branch 'ls/travis-submitting-patches'Libravatar Junio C Hamano1-17/+63
* ls/travis-submitting-patches: Documentation: add setup instructions for Travis CI
2016-05-10Merge branch 'js/close-packs-before-gc'Libravatar Junio C Hamano1-0/+1
* js/close-packs-before-gc: t5510: run auto-gc in the foreground
2016-05-10Merge branch 'ew/normal-to-e'Libravatar Junio C Hamano1-0/+1
* ew/normal-to-e: .mailmap: update to my shorter email address
2016-05-10Merge branch 'ls/p4-lfs'Libravatar Junio C Hamano3-10/+24
Recent update to Git LFS broke "git p4" by changing the output from its "lfs pointer" subcommand. * ls/p4-lfs: git-p4: fix Git LFS pointer parsing travis-ci: express Linux/OS X dependency versions more clearly travis-ci: update Git-LFS and P4 to the latest version
2016-05-10Merge branch 'sb/misc-cleanups'Libravatar Junio C Hamano2-10/+7
* sb/misc-cleanups: submodule-config: don't shadow `cache` config.c: drop local variable
2016-05-10Merge branch 'ew/doc-split-pack-disables-bitmap'Libravatar Junio C Hamano4-9/+23
Doc update. * ew/doc-split-pack-disables-bitmap: pack-objects: warn on split packs disabling bitmaps
2016-05-08Git/SVN: die when there is no commit metadataLibravatar Christian Couder1-1/+2
When passing a bad --trunk option to `git svn clone`, like for example the same URL that we are cloning: C:\Windows\system32>git svn clone https://mycompany.svn.beanstalkapp.com/myproject --no-metadata -A c:\temp\svn_to_git_users.txt --trunk=https://mycompany.svn.beanstalkapp.com/myproject --tags=https://mycompany.svn.beanstalkapp.com/myproject/tags --branches=https://mycompany.svn.beanstalkapp.com/myproject/branches c:\code\Git_myproject One gets an "Use of uninitialized value $u in substitution (s///)" error: [...] W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/MS WCSF Contrib/src/Services W: +empty_dir: branches/20080918_DBDEPLOY/vendor/src/csharp/RealWorldControls/References r530 = c276e3b039d8e38759c6fb17443349732552d7a2 (refs/remotes/origin/trunk) Found possible branch point: https://mycompany.svn.beanstalkapp.com/myproject/trunk => https://mycompany.svn.beanstalkapp.com/myproject/branches/20080918_DBDEPLOY, 529 Use of uninitialized value $u in substitution (s///) at /mingw32/share/perl5/site_perl/Git/SVN.pm line 101. Use of uninitialized value $u in concatenation (.) or string at /mingw32/share/perl5/site_perl/Git/SVN.pm line 101. refs/remotes/origin/trunk: 'https://mycompany.svn.beanstalkapp.com/myproject' not found in '' C:\Windows\system32> Let's fix that by just die()ing when we have an uninitialized value because we cannot get commit metadata from a ref. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Eric Wong <e@80x24.org>
2016-05-06Sync with maintLibravatar Junio C Hamano1-0/+9
* maint: Almost ready for 2.8.3
2016-05-06Almost ready for 2.8.3Libravatar Junio C Hamano1-0/+9
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-06Merge branch 'sb/submodule-path-misc-bugs' into maintLibravatar Junio C Hamano3-11/+133
"git submodule" reports the paths of submodules the command recurses into, but this was incorrect when the command was not run from the root level of the superproject. * sb/submodule-path-misc-bugs: t7407: make expectation as clear as possible submodule update: test recursive path reporting from subdirectory submodule update: align reporting path for custom command execution submodule status: correct path handling in recursive submodules submodule update --init: correct path handling in recursive submodules submodule foreach: correct path display in recursive submodules
2016-05-06Merge branch 'ky/imap-send-openssl-1.1.0' into maintLibravatar Junio C Hamano5-28/+21
Upcoming OpenSSL 1.1.0 will break compilation b updating a few APIs we use in imap-send, which has been adjusted for the change. * ky/imap-send-openssl-1.1.0: configure: remove checking for HMAC_CTX_cleanup imap-send: avoid deprecated TLSv1_method() imap-send: check NULL return of SSL_CTX_new() imap-send: use HMAC() function provided by OpenSSL
2016-05-06Merge branch 'js/replace-edit-use-editor-configuration' into maintLibravatar Junio C Hamano1-0/+1
"git replace -e" did not honour "core.editor" configuration. * js/replace-edit-use-editor-configuration: replace --edit: respect core.editor
2016-05-06Merge branch 'cc/apply' into maintLibravatar Junio C Hamano1-15/+15
Minor code clean-up. * cc/apply: builtin/apply: free patch when parse_chunk() fails builtin/apply: handle parse_binary() failure apply: remove unused call to free() in gitdiff_{old,new}name() builtin/apply: get rid of useless 'name' variable
2016-05-06Merge branch 'kn/for-each-tag-branch' into maintLibravatar Junio C Hamano1-1/+1
A minor documentation update. * kn/for-each-tag-branch: for-each-ref: fix description of '--contains' in manpage
2016-05-06Tenth batch for 2.9Libravatar Junio C Hamano1-2/+30
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-06Merge branch 'jk/diff-compact-heuristic'Libravatar Junio C Hamano3-4/+49
Patch output from "git diff" and friends has been tweaked to be more readable by using a blank line as a strong hint that the contents before and after it belong to a logically separate unit. * jk/diff-compact-heuristic: diff: undocument the compaction heuristic knobs for experimentation xdiff: implement empty line chunk heuristic xdiff: add recs_match helper function
2016-05-06Merge branch 'ls/p4-lfs-test-fix-2.7.0'Libravatar Junio C Hamano1-1/+1
Fix a broken test. * ls/p4-lfs-test-fix-2.7.0: t9824: fix wrong reference value t9824: fix broken &&-chain in a subshell
2016-05-06Merge branch 'bc/object-id'Libravatar Junio C Hamano21-98/+109
Move from unsigned char[20] to struct object_id continues. * bc/object-id: match-trees: convert several leaf functions to use struct object_id tree-walk: convert tree_entry_extract() to use struct object_id struct name_entry: use struct object_id instead of unsigned char sha1[20] match-trees: convert shift_tree() and shift_tree_by() to use object_id test-match-trees: convert to use struct object_id sha1-name: introduce a get_oid() function
2016-05-06Merge branch 'bw/rebase-merge-entire-branch'Libravatar Junio C Hamano3-3/+14
"git rebase -m" could be asked to rebase an entire branch starting from the root, but failed by assuming that there always is a parent commit to the first commit on the branch. * bw/rebase-merge-entire-branch: git-rebase--merge: don't include absent parent as a base
2016-05-06Merge branch 'jc/drop-git-spec-in'Libravatar Junio C Hamano2-343/+6
As nobody maintains our in-tree git.spec.in and distros use their own spec file, we stopped pretending that we support "make rpm". * jc/drop-git-spec-in: Makefile: remove dependency on git.spec Makefile: stop pretending to support rpmbuild
2016-05-06Merge branch 'js/http-custom-headers'Libravatar Junio C Hamano7-10/+61
HTTP transport clients learned to throw extra HTTP headers at the server, specified via http.extraHeader configuration variable. * js/http-custom-headers: http: support sending custom HTTP headers
2016-05-06Merge branch 'sb/clone-shallow-passthru'Libravatar Junio C Hamano3-3/+100
"git clone" learned "--shallow-submodules" option. * sb/clone-shallow-passthru: clone: add `--shallow-submodules` flag
2016-05-06Merge branch 'ld/p4-test-py3'Libravatar Junio C Hamano2-6/+7
The test scripts for "git p4" (but not "git p4" implementation itself) has been updated so that they would work even on a system where the installed version of Python is python 3. * ld/p4-test-py3: git-p4 tests: time_in_seconds should use $PYTHON_PATH git-p4 tests: work with python3 as well as python2 git-p4 tests: cd to / before running python
2016-05-06Merge branch 'sb/config-exit-status-list'Libravatar Junio C Hamano1-3/+3
Doc update. * sb/config-exit-status-list: config doc: improve exit code listing
2016-05-03Sync with maintLibravatar Junio C Hamano8-143/+476
* maint: git-multimail: update to release 1.3.0
2016-05-03Ninth batch for 2.9Libravatar Junio C Hamano1-46/+30
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-03Merge branch 'nf/mergetool-prompt'Libravatar Junio C Hamano4-5/+5
UI consistency improvements. * nf/mergetool-prompt: difftool/mergetool: make the form of yes/no questions consistent
2016-05-03Merge branch 'jd/send-email-to-whom'Libravatar Junio C Hamano1-2/+3
A question by "git send-email" to ask the identity of the sender has been updated. * jd/send-email-to-whom: send-email: fix grammo in the prompt that asks e-mail recipients
2016-05-03Merge branch 'rt/string-list-lookup-cleanup'Libravatar Junio C Hamano1-4/+4
Code cleanup. * rt/string-list-lookup-cleanup: string_list: use string-list API in unsorted_string_list_lookup()
2016-05-03Merge branch 'jk/fix-attribute-macro-in-2.5'Libravatar Junio C Hamano1-1/+1
Code fixup. * jk/fix-attribute-macro-in-2.5: remote.c: spell __attribute__ correctly
2016-05-03Merge branch 'sg/test-lib-simplify-expr-away'Libravatar Junio C Hamano1-5/+5
Code cleanup. * sg/test-lib-simplify-expr-away: test-lib: simplify '--option=value' parsing