* [PATCH v3 01/13] .mailmap: Use my personal email address as my canonical
From: Richard Hansen @ 2017-01-09 5:42 UTC (permalink / raw)
To: git; +Cc: davvid, j6t, hansenr, sbeller, simon
In-Reply-To: <20170109054238.42599-1-hansenr@google.com>
[-- Attachment #1: Type: text/plain, Size: 1036 bytes --]
When I changed employers my work address changed from rhansen@bbn.com
to hansenr@google.com. Rather than map my old work address to my new,
map them both to my permanent personal email address. (I will still
use my work address in commits I submit so that my employer gets some
credit.)
Signed-off-by: Richard Hansen <hansenr@google.com>
---
.mailmap | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.mailmap b/.mailmap
index 9cc33e925..9c87a3840 100644
--- a/.mailmap
+++ b/.mailmap
@@ -192,6 +192,8 @@ Philippe Bruhat <book@cpan.org>
Ralf Thielow <ralf.thielow@gmail.com> <ralf.thielow@googlemail.com>
Ramsay Jones <ramsay@ramsayjones.plus.com> <ramsay@ramsay1.demon.co.uk>
René Scharfe <l.s.r@web.de> <rene.scharfe@lsrfire.ath.cx>
+Richard Hansen <rhansen@rhansen.org> <hansenr@google.com>
+Richard Hansen <rhansen@rhansen.org> <rhansen@bbn.com>
Robert Fitzsimons <robfitz@273k.net>
Robert Shearman <robertshearman@gmail.com> <rob@codeweavers.com>
Robert Zeh <robert.a.zeh@gmail.com>
--
2.11.0.390.gc69c2f50cf-goog
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]
^ permalink raw reply related
* [PATCH v3 00/13] fix mergetool+rerere+subdir regression
From: Richard Hansen @ 2017-01-09 5:42 UTC (permalink / raw)
To: git; +Cc: davvid, j6t, hansenr, sbeller, simon
In-Reply-To: <20170106010945.79382-1-hansenr@google.com>
[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]
If rerere is enabled, no pathnames are given, and mergetool is run
from a subdirectory, mergetool always prints "No files need merging".
Fix the bug.
This regression was introduced in
57937f70a09c12ef484c290865dac4066d207c9c (v2.11.0).
Changes since v2:
* Added entries to .mailmap.
* Patch 2/4 was split into multiple separate commits.
* Moved '-O' out of $orderfile.
* $orderfile is now adjusted after running cd_to_toplevel.
* Added lots of comments.
* Other minor tweaks to address review feedback.
Richard Hansen (13):
.mailmap: Use my personal email address as my canonical
t7610: update branch names to match test number
t7610: Move setup code to the 'setup' test case.
t7610: use test_when_finished for cleanup tasks
t7610: don't rely on state from previous test
t7610: run 'git reset --hard' after each test to clean up
t7610: delete some now-unnecessary 'git reset --hard' lines
t7610: always work on a test-specific branch
t7610: don't assume the checked-out commit
t7610: spell 'git reset --hard' consistently
t7610: add test case for rerere+mergetool+subdir bug
mergetool: take the "-O" out of $orderfile
mergetool: fix running in subdir when rerere enabled
.mailmap | 2 +
git-mergetool.sh | 36 ++++++-
t/t7610-mergetool.sh | 276 ++++++++++++++++++++++++++++++---------------------
3 files changed, 197 insertions(+), 117 deletions(-)
--
2.11.0.390.gc69c2f50cf-goog
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]
^ permalink raw reply
* Re: [PATCH v3] log --graph: customize the graph lines with config log.graphColors
From: Jeff King @ 2017-01-09 5:34 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano
In-Reply-To: <20170108101333.26221-1-pclouds@gmail.com>
On Sun, Jan 08, 2017 at 05:13:33PM +0700, Nguyễn Thái Ngọc Duy wrote:
> If you have a 256 colors terminal (or one with true color support), then
> the predefined 12 colors seem limited. On the other hand, you don't want
> to draw graph lines with every single color in this mode because the two
> colors could look extremely similar. This option allows you to hand pick
> the colors you want.
>
> Even with standard terminal, if your background color is neither black
> or white, then the graph line may match your background and become
> hidden. You can exclude your background color (or simply the colors you
> hate) with this.
I like this approach much more than the 256-color option.
> * I'm not going with the cumulative behavior because I think that's
> just harder to manage colors, and we would need a way to remove
> colors from the config too.
Yeah, figuring out the list semantics would be a pain. This makes it
hard to exclude a single color, but I think it's more likely somebody
would want to replace the whole set with something that works well
against their background.
> +test_expect_success 'log --graph with merge with log.graphColors' '
> + test_config log.graphColors " blue , cyan , red " &&
This funny syntax isn't required, right? It should work with the more
natural:
test_config log.graphColors "blue, cyan, red"
-Peff
^ permalink raw reply
* Re: [PATCH v3] log --graph: customize the graph lines with config log.graphColors
From: Jeff King @ 2017-01-09 5:30 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy, git
In-Reply-To: <xmqq37gtyluf.fsf@gitster.mtv.corp.google.com>
On Sun, Jan 08, 2017 at 07:05:12PM -0800, Junio C Hamano wrote:
> > +{
> > + static char **colors;
> > + static int colors_max, colors_alloc;
> > + char *string = NULL;
> > + const char *end, *start;
> > + int i;
> > +
> > + for (i = 0; i < colors_max; i++)
> > + free(colors[i]);
> > + if (colors)
> > + free(colors[colors_max]);
> > + colors_max = 0;
>
> The correctness of the first loop relies on the fact that colors is
> non-null when colors_max is not zero, and then the freeing of the
> colors relies on something else. It is not wrong per-se, but it
> will reduce the "Huh?" factor if you wrote it like so:
>
> if (colors) {
> /*
> * Reinitialize, but keep the colors[] array.
> * Note that the last entry is allocated for
> * reset but colors_max does not count it, hence
> * "i <= colors_max", not "i < colors_max".
> */
> int i;
> for (i = 0; i <= colors_max; i++)
> free(colors[i]);
> colors_max = 0;
> }
Yeah, I agree that what you've written here is less confusing. Less
confusing still would be to keep colors_nr, and deal separately with the
"max" interface to graph_set_column_colors().
I also wonder if it is worth just using argv_array. We do not care about
NULL-terminating the list here, but it actually works pretty well as a
generic string-array class (and keeping a NULL at the end of any
array-of-pointers is a reasonable defensive measure). Then the function
becomes:
argv_array_clear(&colors);
...
if (!color_parse_mem(..., color))
argv_array_push(&colors, color);
...
argv_array_push(&colors, GIT_COLOR_RESET);
/* graph_set_column_colors takes a max-index, not a count */
graph_set_column_colors(colors.argv, colors.argc - 1);
It is not much shorter than ALLOC_GROW(), but IMHO it is easier to read.
-Peff
^ permalink raw reply
* Re: git branch -D doesn't work with deleted worktree
From: Jacob Keller @ 2017-01-09 3:44 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Stefan Beller, Roland Illig, git@vger.kernel.org
In-Reply-To: <CACsJy8C6QWeHSwhsYyJnupkue=aoCG+3Tecytb_0p+gB-CuVKg@mail.gmail.com>
On Fri, Jan 6, 2017 at 2:05 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> On Thu, Jan 5, 2017 at 9:02 PM, Stefan Beller <sbeller@google.com> wrote:
>> On Thu, Jan 5, 2017 at 2:06 AM, Roland Illig <rillig@novomind.com> wrote:
>>> Git 2.11.0 gives a wrong error message after the following commands:
>>>
>>> $ git init
>>> $ echo hello >file
>>> $ git add file
>>> $ git commit -m "message"
>>> $ git worktree add ../worktree
>>> $ rm -rf ../worktree
>>> $ git br -D worktree
>>> error: Cannot delete branch 'worktree' checked out at '../worktree'
>>>
>>> Since ../worktree has been deleted, there cannot be anything checked out at that location.
>>>
>>> In my opinion, deleting the branch should just work. Especially since I used the -D option and the "git worktree" documentation says "When you are done with a linked working tree you can simply delete it."
>
> Since -D means "I know what I'm doing, get out of my way", maybe we
> should continue if any worktree has the branch checked out by
> detaching it?
>
> (Yes I'm carefully tip toeing around the deleted worktree issue since
> "git worktree remove" is coming. After that point, running "worktree
> prune" before "branch -D" does not sound so bad)
> --
> Duy
Why not just update the documentation to be "when you are done with a
work tree you can delete it and then run git worktree prune"?
Thanks,
Jake
^ permalink raw reply
* What's cooking in git.git (preview)
From: Junio C Hamano @ 2017-01-09 3:36 UTC (permalink / raw)
To: git
There still are topics that haven't been looked at, but here is a
snapshot of my tonight's status. The tip of 'pu' is known to be
broken, so those who want to vet and veto topics that are outside
but close to 'next' may want to try the tip of 'jch' instead (find
it in "git log --first-parent master..pu").
You can find the changes described here in the integration branches
of the repositories listed at
http://git-blame.blogspot.com/p/git-public-repositories.html
--------------------------------------------------
[New Topics]
* ls/p4-retry-thrice (2016-12-29) 1 commit
- git-p4: do not pass '-r 0' to p4 commands
A recent updates to "git p4" was not usable for older p4 but it
could be made to work with minimum changes. Do so.
Will merge to 'next'.
* mh/ref-remove-empty-directory (2017-01-07) 23 commits
- files_transaction_commit(): clean up empty directories
- try_remove_empty_parents(): teach to remove parents of reflogs, too
- try_remove_empty_parents(): don't trash argument contents
- try_remove_empty_parents(): rename parameter "name" -> "refname"
- delete_ref_loose(): inline function
- delete_ref_loose(): derive loose reference path from lock
- log_ref_write_1(): inline function
- log_ref_setup(): manage the name of the reflog file internally
- log_ref_write_1(): don't depend on logfile argument
- log_ref_setup(): pass the open file descriptor back to the caller
- log_ref_setup(): improve robustness against races
- log_ref_setup(): separate code for create vs non-create
- log_ref_write(): inline function
- rename_tmp_log(): improve error reporting
- rename_tmp_log(): use raceproof_create_file()
- lock_ref_sha1_basic(): use raceproof_create_file()
- lock_ref_sha1_basic(): inline constant
- raceproof_create_file(): new function
- safe_create_leading_directories(): set errno on SCLD_EXISTS
- safe_create_leading_directories_const(): preserve errno
- t5505: use "for-each-ref" to test for the non-existence of references
- refname_is_safe(): correct docstring
- files_rename_ref(): tidy up whitespace
Deletion of a branch "foo/bar" could remove .git/refs/heads/foo
once there no longer is any other branch whose name begins with
"foo/", but we didn't do so so far. Now we do.
Expecting a reroll.
cf. <5051c78e-51f9-becd-e1a6-9c0b781d6912@alum.mit.edu>
* pb/test-must-fail-is-for-git (2017-01-07) 2 commits
- t9813: avoid using pipes
- don't use test_must_fail with grep
Test cleanup.
Will merge to 'next'.
* rs/unpack-trees-reduce-file-scope-global (2016-12-31) 1 commit
- unpack-trees: move checkout state into check_updates
Code cleanup.
Will merge to 'next'.
* jk/archive-zip-userdiff-config (2017-01-07) 1 commit
- archive-zip: load userdiff config
* jk/blame-fixes (2017-01-07) 3 commits
- blame: output porcelain "previous" header for each file
- blame: handle --no-abbrev
- blame: fix alignment with --abbrev=40
* jk/rebase-i-squash-count-fix (2017-01-07) 1 commit
- rebase--interactive: count squash commits above 10 correctly
* js/asciidoctor-tweaks (2017-01-07) 1 commit
- giteveryday: unbreak rendering with AsciiDoctor
* km/branch-get-push-while-detached (2017-01-07) 1 commit
- branch_get_push: do not segfault when HEAD is detached
* sb/remove-gitview (2017-01-07) 1 commit
- contrib: remove gitview
* sb/submodule-cleanup-export-git-dir-env (2017-01-07) 1 commit
- submodule.c: use GIT_DIR_ENVIRONMENT consistently
* sb/pathspec-errors (2017-01-08) 6 commits
- pathspec: give better message for submodule related pathspec error
- submodule tests: don't use itself as a submodule
- Merge "test_commit -C" from sb/submodule-embed-gitdir topic
+ test-lib-functions.sh: teach test_commit -C <dir>
+ submodule helper: support super prefix
+ submodule: use absolute path for computing relative path connecting
(this branch uses bw/pathspec-cleanup; is tangled with sb/submodule-embed-gitdir and sb/submodule-rm-absorb.)
--------------------------------------------------
[Stalled]
* jk/nofollow-attr-ignore (2016-11-02) 5 commits
- exclude: do not respect symlinks for in-tree .gitignore
- attr: do not respect symlinks for in-tree .gitattributes
- exclude: convert "check_index" into a flags field
- attr: convert "macro_ok" into a flags field
- add open_nofollow() helper
As we do not follow symbolic links when reading control files like
.gitignore and .gitattributes from the index, match the behaviour
and not follow symbolic links when reading them from the working
tree. This also tightens security a bit by not leaking contents of
an unrelated file in the error messages when it is pointed at by
one of these files that is a symbolic link.
Perhaps we want to cover .gitmodules too with the same mechanism?
* nd/worktree-move (2016-11-28) 11 commits
. worktree remove: new command
. worktree move: refuse to move worktrees with submodules
. worktree move: accept destination as directory
. worktree move: new command
. worktree.c: add update_worktree_location()
. worktree.c: add validate_worktree()
. copy.c: convert copy_file() to copy_dir_recursively()
. copy.c: style fix
. copy.c: convert bb_(p)error_msg to error(_errno)
. copy.c: delete unused code in copy_file()
. copy.c: import copy_file() from busybox
"git worktree" learned move and remove subcommands.
Reported to break builds on Windows.
* jc/bundle (2016-03-03) 6 commits
- index-pack: --clone-bundle option
- Merge branch 'jc/index-pack' into jc/bundle
- bundle v3: the beginning
- bundle: keep a copy of bundle file name in the in-core bundle header
- bundle: plug resource leak
- bundle doc: 'verify' is not about verifying the bundle
The beginning of "split bundle", which could be one of the
ingredients to allow "git clone" traffic off of the core server
network to CDN.
While I think it would make it easier for people to experiment and
build on if the topic is merged to 'next', I am at the same time a
bit reluctant to merge an unproven new topic that introduces a new
file format, which we may end up having to support til the end of
time. It is likely that to support a "prime clone from CDN", it
would need a lot more than just "these are the heads and the pack
data is over there", so this may not be sufficient.
Will discard.
* mh/connect (2016-06-06) 10 commits
- connect: [host:port] is legacy for ssh
- connect: move ssh command line preparation to a separate function
- connect: actively reject git:// urls with a user part
- connect: change the --diag-url output to separate user and host
- connect: make parse_connect_url() return the user part of the url as a separate value
- connect: group CONNECT_DIAG_URL handling code
- connect: make parse_connect_url() return separated host and port
- connect: re-derive a host:port string from the separate host and port variables
- connect: call get_host_and_port() earlier
- connect: document why we sometimes call get_port after get_host_and_port
Rewrite Git-URL parsing routine (hopefully) without changing any
behaviour.
It has been two months without any support. We may want to discard
this.
* ec/annotate-deleted (2015-11-20) 1 commit
- annotate: skip checking working tree if a revision is provided
Usability fix for annotate-specific "<file> <rev>" syntax with deleted
files.
Has been waiting for a review for too long without seeing anything.
Will discard.
* dk/gc-more-wo-pack (2016-01-13) 4 commits
- gc: clean garbage .bitmap files from pack dir
- t5304: ensure non-garbage files are not deleted
- t5304: test .bitmap garbage files
- prepare_packed_git(): find more garbage
Follow-on to dk/gc-idx-wo-pack topic, to clean up stale
.bitmap and .keep files.
Has been waiting for a reroll for too long.
cf. <xmqq60ypbeng.fsf@gitster.mtv.corp.google.com>
Will discard.
* jc/diff-b-m (2015-02-23) 5 commits
. WIPWIP
. WIP: diff-b-m
- diffcore-rename: allow easier debugging
- diffcore-rename.c: add locate_rename_src()
- diffcore-break: allow debugging
"git diff -B -M" produced incorrect patch when the postimage of a
completely rewritten file is similar to the preimage of a removed
file; such a resulting file must not be expressed as a rename from
other place.
The fix in this patch is broken, unfortunately.
Will discard.
--------------------------------------------------
[Cooking]
* dt/disable-bitmap-in-auto-gc (2016-12-29) 2 commits
- repack: die on incremental + write-bitmap-index
- auto gc: don't write bitmaps for incremental repacks
It is natural that "git gc --auto" may not attempt to pack
everything into a single pack, and there is no point in warning
when the user has configured the system to use the pack bitmap,
leading to disabling further "gc".
Will merge to 'next'.
* js/mingw-test-push-unc-path (2017-01-07) 1 commit
- mingw: add a regression test for pushing to UNC paths
"git push \\server\share\dir" has recently regressed and then
fixed. A test has retroactively been added for this breakage.
Will merge to 'next'.
* nd/log-graph-configurable-colors (2017-01-08) 1 commit
- log --graph: customize the graph lines with config log.graphColors
Some people feel the default set of colors used by "git log --graph"
rather limiting. A mechanism to customize the set of colors has
been introduced.
Waiting for review to conclude.
cf. <20170108101333.26221-1-pclouds@gmail.com>
* sb/submodule-rm-absorb (2016-12-27) 4 commits
- rm: absorb a submodules git dir before deletion
- submodule: rename and add flags to ok_to_remove_submodule
- submodule: modernize ok_to_remove_submodule to use argv_array
- submodule.h: add extern keyword to functions
(this branch uses sb/submodule-embed-gitdir; is tangled with sb/pathspec-errors.)
"git rm" used to refuse to remove a submodule when it has its own
git repository embedded in its working tree. It learned to move
the repository away to $GIT_DIR/modules/ of the superproject
instead, and allow the submodule to be deleted (as long as there
will be no loss of local modifications, that is).
* cc/split-index-config (2016-12-26) 21 commits
- Documentation/git-update-index: explain splitIndex.*
- Documentation/config: add splitIndex.sharedIndexExpire
- read-cache: use freshen_shared_index() in read_index_from()
- read-cache: refactor read_index_from()
- t1700: test shared index file expiration
- read-cache: unlink old sharedindex files
- config: add git_config_get_expiry() from gc.c
- read-cache: touch shared index files when used
- sha1_file: make check_and_freshen_file() non static
- Documentation/config: add splitIndex.maxPercentChange
- t1700: add tests for splitIndex.maxPercentChange
- read-cache: regenerate shared index if necessary
- config: add git_config_get_max_percent_split_change()
- Documentation/git-update-index: talk about core.splitIndex config var
- Documentation/config: add information for core.splitIndex
- t1700: add tests for core.splitIndex
- update-index: warn in case of split-index incoherency
- read-cache: add and then use tweak_split_index()
- split-index: add {add,remove}_split_index() functions
- config: add git_config_get_split_index()
- config: mark an error message up for translation
The experimental "split index" feature has gained a few
configuration variables to make it easier to use.
Waiting for review to conclude.
cf. <20161226102222.17150-1-chriscool@tuxfamily.org>
cf. <a1a44640-ff6c-2294-72ac-46322eff8505@ramsayjones.plus.com>
* jc/abbrev-autoscale-config (2016-12-22) 1 commit
(merged to 'next' on 2016-12-27 at 631e4200e2)
+ config.abbrev: document the new default that auto-scales
Recent update to the default abbreviation length that auto-scales
lacked documentation update, which has been corrected.
Will merge to 'master'.
* jc/retire-compaction-heuristics (2016-12-23) 1 commit
(merged to 'next' on 2016-12-27 at c69c2f50cf)
+ diff: retire "compaction" heuristics
"git diff" and its family had two experimental heuristics to shift
the contents of a hunk to make the patch easier to read. One of
them turns out to be better than the other, so leave only the
"--indent-heuristic" option and remove the other one.
Will merge to 'master'.
* bw/push-submodule-only (2016-12-20) 3 commits
- push: add option to push only submodules
- submodules: add RECURSE_SUBMODULES_ONLY value
- transport: reformat flag #defines to be more readable
"git submodule push" learned "--recurse-submodules=only option to
push submodules out without pushing the top-level superproject.
* nd/config-misc-fixes (2016-12-22) 3 commits
(merged to 'next' on 2016-12-27 at 6be64a8671)
+ config.c: handle lock file in error case in git_config_rename_...
+ config.c: rename label unlock_and_out
+ config.c: handle error case for fstat() calls
Leakage of lockfiles in the config subsystem has been fixed.
Will merge to 'master'.
* ls/p4-path-encoding (2016-12-18) 1 commit
- git-p4: fix git-p4.pathEncoding for removed files
When "git p4" imports changelist that removes paths, it failed to
convert pathnames when the p4 used encoding different from the one
used on the Git side. This has been corrected.
Will be rerolled.
cf. <7E1C7387-4F37-423F-803D-3B5690B49D40@gmail.com>
* mh/fast-import-notes-fix-new (2016-12-20) 1 commit
(merged to 'next' on 2016-12-27 at b63805e6f6)
+ fast-import: properly fanout notes when tree is imported
"git fast-import" sometimes mishandled while rebalancing notes
tree, which has been fixed.
Will merge to 'master'.
* bw/pathspec-cleanup (2017-01-08) 16 commits
- pathspec: rename prefix_pathspec to init_pathspec_item
- pathspec: small readability changes
- pathspec: create strip submodule slash helpers
- pathspec: create parse_element_magic helper
- pathspec: create parse_long_magic function
- pathspec: create parse_short_magic function
- pathspec: factor global magic into its own function
- pathspec: simpler logic to prefix original pathspec elements
- pathspec: always show mnemonic and name in unsupported_magic
- pathspec: remove unused variable from unsupported_magic
- pathspec: copy and free owned memory
- pathspec: remove the deprecated get_pathspec function
- ls-tree: convert show_recursive to use the pathspec struct interface
- dir: convert fill_directory to use the pathspec struct interface
- dir: remove struct path_simplify
- mv: remove use of deprecated 'get_pathspec()'
(this branch is used by sb/pathspec-errors.)
Code clean-up in the pathspec API.
Will merge to 'next'.
* js/prepare-sequencer-more (2016-12-14) 34 commits
- sequencer (rebase -i): write out the final message
- sequencer (rebase -i): write the progress into files
- sequencer (rebase -i): show the progress
- sequencer (rebase -i): suggest --edit-todo upon unknown command
- sequencer (rebase -i): show only failed cherry-picks' output
- sequencer (rebase -i): show only failed `git commit`'s output
- run_command_opt(): optionally hide stderr when the command succeeds
- sequencer (rebase -i): differentiate between comments and 'noop'
- sequencer (rebase -i): implement the 'drop' command
- sequencer (rebase -i): allow rescheduling commands
- sequencer (rebase -i): respect strategy/strategy_opts settings
- sequencer (rebase -i): respect the rebase.autostash setting
- sequencer (rebase -i): run the post-rewrite hook, if needed
- sequencer (rebase -i): record interrupted commits in rewritten, too
- sequencer (rebase -i): copy commit notes at end
- sequencer (rebase -i): set the reflog message consistently
- sequencer (rebase -i): refactor setting the reflog message
- sequencer (rebase -i): allow fast-forwarding for edit/reword
- sequencer (rebase -i): implement the 'reword' command
- sequencer (rebase -i): leave a patch upon error
- sequencer (rebase -i): update refs after a successful rebase
- sequencer (rebase -i): the todo can be empty when continuing
- sequencer (rebase -i): skip some revert/cherry-pick specific code path
- sequencer (rebase -i): remove CHERRY_PICK_HEAD when no longer needed
- sequencer (rebase -i): allow continuing with staged changes
- sequencer (rebase -i): write an author-script file
- sequencer (rebase -i): implement the short commands
- sequencer (rebase -i): add support for the 'fixup' and 'squash' commands
- sequencer (rebase -i): write the 'done' file
- sequencer (rebase -i): learn about the 'verbose' mode
- sequencer (rebase -i): implement the 'exec' command
- sequencer (rebase -i): implement the 'edit' command
- sequencer (rebase -i): implement the 'noop' command
- sequencer: support a new action: 'interactive rebase'
The sequencer has further been extended in preparation to act as a
back-end for "rebase -i".
Waiting for review to conclude.
* bw/realpath-wo-chdir (2016-12-22) 5 commits
(merged to 'next' on 2016-12-22 at fea8fa870f)
+ real_path: canonicalize directory separators in root parts
+ real_path: have callers use real_pathdup and strbuf_realpath
+ real_path: create real_pathdup
+ real_path: convert real_path_internal to strbuf_realpath
+ real_path: resolve symlinks by hand
(this branch is used by bw/grep-recurse-submodules.)
The implementation of "real_path()" was to go there with chdir(2)
and call getcwd(3), but this obviously wouldn't be usable in a
threaded environment. Rewrite it to manually resolve relative
paths including symbolic links in path components.
* js/difftool-builtin (2017-01-08) 4 commits
- t7800: run both builtin and scripted difftool, for now
- difftool: implement the functionality in the builtin
- difftool: add a skeleton for the upcoming builtin
- git_exec_path: avoid Coverity warning about unfree()d result
Rewrite a scripted porcelain "git difftool" in C.
What's the doneness of this topic?
* sb/push-make-submodule-check-the-default (2016-11-29) 2 commits
(merged to 'next' on 2016-12-12 at 1863e05af5)
+ push: change submodule default to check when submodules exist
+ submodule add: extend force flag to add existing repos
Turn the default of "push.recurseSubmodules" to "check" when
submodules seem to be in use.
Will cook in 'next'.
* sb/submodule-embed-gitdir (2016-12-27) 7 commits
(merged to 'next' on 2016-12-27 at 2b43c15479)
+ worktree: initialize return value for submodule_uses_worktrees
(merged to 'next' on 2016-12-21 at e6cdbcf013)
+ submodule: add absorb-git-dir function
+ move connect_work_tree_and_git_dir to dir.h
+ worktree: check if a submodule uses worktrees
+ test-lib-functions.sh: teach test_commit -C <dir>
+ submodule helper: support super prefix
+ submodule: use absolute path for computing relative path connecting
(this branch is used by sb/submodule-rm-absorb; is tangled with sb/pathspec-errors.)
A new submodule helper "git submodule embedgitdirs" to make it
easier to move embedded .git/ directory for submodules in a
superproject to .git/modules/ (and point the latter with the former
that is turned into a "gitdir:" file) has been added.
Will merge to 'master'.
* bw/grep-recurse-submodules (2016-12-22) 7 commits
(merged to 'next' on 2016-12-22 at 1ede815b8d)
+ grep: search history of moved submodules
+ grep: enable recurse-submodules to work on <tree> objects
+ grep: optionally recurse into submodules
+ grep: add submodules as a grep source type
+ submodules: load gitmodules file from commit sha1
+ submodules: add helper to determine if a submodule is initialized
+ submodules: add helper to determine if a submodule is populated
(this branch uses bw/realpath-wo-chdir.)
"git grep" learns to optionally recurse into submodules.
Will merge to 'master'.
* dt/smart-http-detect-server-going-away (2016-11-18) 2 commits
(merged to 'next' on 2016-12-05 at 3ea70d01af)
+ upload-pack: optionally allow fetching any sha1
+ remote-curl: don't hang when a server dies before any output
Originally merged to 'next' on 2016-11-21
When the http server gives an incomplete response to a smart-http
rpc call, it could lead to client waiting for a full response that
will never come. Teach the client side to notice this condition
and abort the transfer.
An improvement counterproposal has failed.
cf. <20161114194049.mktpsvgdhex2f4zv@sigill.intra.peff.net>
Will merge to 'master'.
* mm/push-social-engineering-attack-doc (2016-11-14) 1 commit
(merged to 'next' on 2016-12-05 at 9a2b5bd1a9)
+ doc: mention transfer data leaks in more places
Originally merged to 'next' on 2016-11-16
Doc update on fetching and pushing.
Will merge to 'master'.
* jc/compression-config (2016-11-15) 1 commit
(merged to 'next' on 2016-12-05 at 323769ca07)
+ compression: unify pack.compression configuration parsing
Originally merged to 'next' on 2016-11-23
Compression setting for producing packfiles were spread across
three codepaths, one of which did not honor any configuration.
Unify these so that all of them honor core.compression and
pack.compression variables the same way.
Will merge to 'master'.
* mm/gc-safety-doc (2016-11-16) 1 commit
(merged to 'next' on 2016-12-05 at 031ecc1886)
+ git-gc.txt: expand discussion of races with other processes
Originally merged to 'next' on 2016-11-17
Doc update.
Will merge to 'master'.
* kn/ref-filter-branch-list (2016-12-27) 20 commits
- branch: implement '--format' option
- branch: use ref-filter printing APIs
- branch, tag: use porcelain output
- ref-filter: allow porcelain to translate messages in the output
- ref-filter: add an 'rstrip=<N>' option to atoms which deal with refnames
- ref-filter: modify the 'lstrip=<N>' option to work with negative '<N>'
- ref-filter: Do not abruptly die when using the 'lstrip=<N>' option
- ref-filter: rename the 'strip' option to 'lstrip'
- ref-filter: make remote_ref_atom_parser() use refname_atom_parser_internal()
- ref-filter: introduce refname_atom_parser()
- ref-filter: introduce refname_atom_parser_internal()
- ref-filter: make "%(symref)" atom work with the ':short' modifier
- ref-filter: add support for %(upstream:track,nobracket)
- ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
- ref-filter: introduce format_ref_array_item()
- ref-filter: move get_head_description() from branch.c
- ref-filter: modify "%(objectname:short)" to take length
- ref-filter: implement %(if:equals=<string>) and %(if:notequals=<string>)
- ref-filter: include reference to 'used_atom' within 'atom_value'
- ref-filter: implement %(if), %(then), and %(else) atoms
The code to list branches in "git branch" has been consolidated
with the more generic ref-filter API.
Waiting for review to conclude.
* jt/fetch-no-redundant-tag-fetch-map (2016-11-11) 1 commit
(merged to 'next' on 2016-12-05 at 432f9469a7)
+ fetch: do not redundantly calculate tag refmap
Originally merged to 'next' on 2016-11-16
Code cleanup to avoid using redundant refspecs while fetching with
the --tags option.
Will merge to 'master'.
* jc/git-open-cloexec (2016-11-02) 3 commits
(merged to 'next' on 2016-12-27 at 487682eb6e)
+ sha1_file: stop opening files with O_NOATIME
+ git_open_cloexec(): use fcntl(2) w/ FD_CLOEXEC fallback
+ git_open(): untangle possible NOATIME and CLOEXEC interactions
The codeflow of setting NOATIME and CLOEXEC on file descriptors Git
opens has been simplified.
Will merge to 'master'.
We may want to drop the tip one, but we'll see.
* jk/no-looking-at-dotgit-outside-repo-final (2016-10-26) 1 commit
(merged to 'next' on 2016-12-05 at 0c77e39cd5)
+ setup_git_env: avoid blind fall-back to ".git"
Originally merged to 'next' on 2016-10-26
This is the endgame of the topic to avoid blindly falling back to
".git" when the setup sequence said we are _not_ in Git repository.
A corner case that happens to work right now may be broken by a
call to die("BUG").
Will cook in 'next'.
* jc/reset-unmerge (2016-10-24) 1 commit
- reset: --unmerge
After "git add" is run prematurely during a conflict resolution,
"git diff" can no longer be used as a way to sanity check by
looking at the combined diff. "git reset" learned a new
"--unmerge" option to recover from this situation.
Will discard.
This may not be needed, given that update-index has a similar
option.
* jc/merge-base-fp-only (2016-10-19) 8 commits
. merge-base: fp experiment
- merge: allow to use only the fp-only merge bases
- merge-base: limit the output to bases that are on first-parent chain
- merge-base: mark bases that are on first-parent chain
- merge-base: expose get_merge_bases_many_0() a bit more
- merge-base: stop moving commits around in remove_redundant()
- sha1_name: remove ONELINE_SEEN bit
- commit: simplify fastpath of merge-base
An experiment of merge-base that ignores common ancestors that are
not on the first parent chain.
Will discard.
The whole premise feels wrong.
* tb/convert-stream-check (2016-10-27) 2 commits
- convert.c: stream and fast search for binary
- read-cache: factor out get_sha1_from_index() helper
End-of-line conversion sometimes needs to see if the current blob
in the index has NULs and CRs to base its decision. We used to
always get a full statistics over the blob, but in many cases we
can return early when we have seen "enough" (e.g. if we see a
single NUL, the blob will be handled as binary). The codepaths
have been optimized by using streaming interface.
Will discard.
Retracted.
cf. <20161102071646.GA5094@tb-raspi>
* pb/bisect (2016-10-18) 27 commits
- bisect--helper: remove the dequote in bisect_start()
- bisect--helper: retire `--bisect-auto-next` subcommand
- bisect--helper: retire `--bisect-autostart` subcommand
- bisect--helper: retire `--bisect-write` subcommand
- bisect--helper: `bisect_replay` shell function in C
- bisect--helper: `bisect_log` shell function in C
- bisect--helper: retire `--write-terms` subcommand
- bisect--helper: retire `--check-expected-revs` subcommand
- bisect--helper: `bisect_state` & `bisect_head` shell function in C
- bisect--helper: `bisect_autostart` shell function in C
- bisect--helper: retire `--next-all` subcommand
- bisect--helper: retire `--bisect-clean-state` subcommand
- bisect--helper: `bisect_next` and `bisect_auto_next` shell function in C
- t6030: no cleanup with bad merge base
- bisect--helper: `bisect_start` shell function partially in C
- bisect--helper: `get_terms` & `bisect_terms` shell function in C
- bisect--helper: `bisect_next_check` & bisect_voc shell function in C
- bisect--helper: `check_and_set_terms` shell function in C
- bisect--helper: `bisect_write` shell function in C
- bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C
- bisect--helper: `bisect_reset` shell function in C
- wrapper: move is_empty_file() and rename it as is_empty_or_missing_file()
- t6030: explicitly test for bisection cleanup
- bisect--helper: `bisect_clean_state` shell function in C
- bisect--helper: `write_terms` shell function in C
- bisect: rewrite `check_term_format` shell function in C
- bisect--helper: use OPT_CMDMODE instead of OPT_BOOL
Move more parts of "git bisect" to C.
Waiting for review to conclude.
* st/verify-tag (2016-10-10) 7 commits
- t/t7004-tag: Add --format specifier tests
- t/t7030-verify-tag: Add --format specifier tests
- builtin/tag: add --format argument for tag -v
- builtin/verify-tag: add --format to verify-tag
- tag: add format specifier to gpg_verify_tag
- ref-filter: add function to print single ref_array_item
- gpg-interface, tag: add GPG_VERIFY_QUIET flag
"git tag" and "git verify-tag" learned to put GPG verification
status in their "--format=<placeholders>" output format.
Waiting for a reroll.
cf. <20161007210721.20437-1-santiago@nyu.edu>
* sb/attr (2016-11-11) 35 commits
. completion: clone can initialize specific submodules
. clone: add --init-submodule=<pathspec> switch
. submodule update: add `--init-default-path` switch
. pathspec: allow escaped query values
. pathspec: allow querying for attributes
. pathspec: move prefix check out of the inner loop
. pathspec: move long magic parsing out of prefix_pathspec
- Documentation: fix a typo
- attr: keep attr stack for each check
- attr: convert to new threadsafe API
- attr: make git_check_attr_counted static
- attr.c: outline the future plans by heavily commenting
- attr.c: always pass check[] to collect_some_attrs()
- attr.c: introduce empty_attr_check_elems()
- attr.c: correct ugly hack for git_all_attrs()
- attr.c: rename a local variable check
- attr.c: pass struct git_attr_check down the callchain
- attr.c: add push_stack() helper
- attr: support quoting pathname patterns in C style
- attr: expose validity check for attribute names
- attr: add counted string version of git_check_attr()
- attr: retire git_check_attrs() API
- attr: convert git_check_attrs() callers to use the new API
- attr: convert git_all_attrs() to use "struct git_attr_check"
- attr: (re)introduce git_check_attr() and struct git_attr_check
- attr: rename function and struct related to checking attributes
- attr.c: plug small leak in parse_attr_line()
- attr.c: tighten constness around "git_attr" structure
- attr.c: simplify macroexpand_one()
- attr.c: mark where #if DEBUG ends more clearly
- attr.c: complete a sentence in a comment
- attr.c: explain the lack of attr-name syntax check in parse_attr()
- attr.c: update a stale comment on "struct match_attr"
- attr.c: use strchrnul() to scan for one line
- commit.c: use strchrnul() to scan for one line
The attributes API has been updated so that it can later be
optimized using the knowledge of which attributes are queried.
Building on top of the updated API, the pathspec machinery learned
to select only paths with given attributes set.
The parts near the tip about pathspec would need to work better
with bw/pathspec-cleanup topic and has been dropped for now.
* jc/latin-1 (2016-09-26) 2 commits
(merged to 'next' on 2016-12-05 at fb549caa12)
+ utf8: accept "latin-1" as ISO-8859-1
+ utf8: refactor code to decide fallback encoding
Originally merged to 'next' on 2016-09-28
Some platforms no longer understand "latin-1" that is still seen in
the wild in e-mail headers; replace them with "iso-8859-1" that is
more widely known when conversion fails from/to it.
Will merge to 'master'.
* sg/fix-versioncmp-with-common-suffix (2016-12-08) 8 commits
- versioncmp: generalize version sort suffix reordering
- squash! versioncmp: use earliest-longest contained suffix to determine sorting order
- versioncmp: use earliest-longest contained suffix to determine sorting order
- versioncmp: cope with common part overlapping with prerelease suffix
- versioncmp: pass full tagnames to swap_prereleases()
- t7004-tag: add version sort tests to show prerelease reordering issues
- t7004-tag: use test_config helper
- t7004-tag: delete unnecessary tags with test_when_finished
The prereleaseSuffix feature of version comparison that is used in
"git tag -l" did not correctly when two or more prereleases for the
same release were present (e.g. when 2.0, 2.0-beta1, and 2.0-beta2
are there and the code needs to compare 2.0-beta1 and 2.0-beta2).
Waiting for review to conclude.
cf. <20161208142401.1329-1-szeder.dev@gmail.com>
* jc/merge-drop-old-syntax (2015-04-29) 1 commit
(merged to 'next' on 2016-12-05 at 041946dae0)
+ merge: drop 'git merge <message> HEAD <commit>' syntax
Originally merged to 'next' on 2016-10-11
Stop supporting "git merge <message> HEAD <commit>" syntax that has
been deprecated since October 2007, and issues a deprecation
warning message since v2.5.0.
Will cook in 'next'.
^ permalink raw reply
* Re: [PATCH] Makefile: POSIX windres
From: Junio C Hamano @ 2017-01-09 3:10 UTC (permalink / raw)
To: Steven Penny, Johannes Schindelin, Johannes Sixt; +Cc: git
In-Reply-To: <20170107214110.3124-1-svnpenn@gmail.com>
Steven Penny <svnpenn@gmail.com> writes:
> When environment variable POSIXLY_CORRECT is set, the "input -o output" syntax
> is not supported.
>
> http://cygwin.com/ml/cygwin/2017-01/msg00036.html
>
> Signed-off-by: Steven Penny <svnpenn@gmail.com>
> ---
Who other than cygwin build uses this target? Git for Windows?
Hannes, Dscho, is this change OK with you guys?
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index d861bd9..a2a1212 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1816,7 +1816,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
> git.res: git.rc GIT-VERSION-FILE
> $(QUIET_RC)$(RC) \
> $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
> - -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
> + -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" -i $< -o $@
>
> # This makes sure we depend on the NO_PERL setting itself.
> $(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
^ permalink raw reply
* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
From: Junio C Hamano @ 2017-01-09 3:07 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Steven Penny, git
In-Reply-To: <alpine.DEB.2.20.1701081953330.3469@virtualbox>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Hi Steven,
>
> On Sun, 8 Jan 2017, Steven Penny wrote:
>
>> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
>> > I am curious: how do you build Git? I ask because I build Git on Windows
>> > many times a day, and I did not encounter any link problems.
>>
>> My end goal is to build static native Windows Git via Cygwin and the
>> mingw64-x86_64-gcc-core package.
>
> That is certainly a worthy goal, and I would highly recommend to mention
> that particular cross-compiling setup in the commit message. It's not like
> this is the easiest way to build native Git on Windows...
In addition to the patch being explained well, I also care that it
does not break existing builds. I do not think it is the case for
you, and I do think the patch does the right thing, but just double
checking to see if you have objections to the change itself.
Thanks.
^ permalink raw reply
* Re: [PATCH v3] log --graph: customize the graph lines with config log.graphColors
From: Junio C Hamano @ 2017-01-09 3:05 UTC (permalink / raw)
To: Nguyễn Thái Ngọc Duy; +Cc: git, Jeff King
In-Reply-To: <20170108101333.26221-1-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> diff --git a/graph.c b/graph.c
> index dd17201..048f5cb 100644
> --- a/graph.c
> +++ b/graph.c
> @@ -62,6 +62,49 @@ enum graph_state {
> static const char **column_colors;
> static unsigned short column_colors_max;
>
> +static void set_column_colors(void)
When I said "'by config' sounds funny", I meant "'from config' may
be more natural". Perhaps name this read_graph_colors_config(), as
that (i.e. reading "log.graphColors") is what it does.
> +{
> + static char **colors;
> + static int colors_max, colors_alloc;
> + char *string = NULL;
> + const char *end, *start;
> + int i;
> +
> + for (i = 0; i < colors_max; i++)
> + free(colors[i]);
> + if (colors)
> + free(colors[colors_max]);
> + colors_max = 0;
The correctness of the first loop relies on the fact that colors is
non-null when colors_max is not zero, and then the freeing of the
colors relies on something else. It is not wrong per-se, but it
will reduce the "Huh?" factor if you wrote it like so:
if (colors) {
/*
* Reinitialize, but keep the colors[] array.
* Note that the last entry is allocated for
* reset but colors_max does not count it, hence
* "i <= colors_max", not "i < colors_max".
*/
int i;
for (i = 0; i <= colors_max; i++)
free(colors[i]);
colors_max = 0;
}
^ permalink raw reply
* Re: [PATCHv6 2/2] pathspec: give better message for submodule related pathspec error
From: Junio C Hamano @ 2017-01-09 2:39 UTC (permalink / raw)
To: Stefan Beller; +Cc: bmwill, peff, git
In-Reply-To: <20170105192904.1107-3-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> Every once in a while someone complains to the mailing list to have
> run into this weird assertion[1]. The usual response from the mailing
> list is link to old discussions[2], and acknowledging the problem
> stating it is known.
>
> This patch accomplishes two things:
>
> 1. Switch assert() to die("BUG") to give a more readable message.
>
> 2. Take one of the cases where we hit a BUG and turn it into a normal
> "there was something wrong with the input" message.
>
> This assertion triggered for cases where there wasn't a programming
> bug, but just bogus input. In particular, if the user asks for a
> pathspec that is inside a submodule, we shouldn't assert() or
> die("BUG"); we should tell the user their request is bogus.
>
> The only reason we did not check for it, is the expensive nature
> of such a check, so callers avoid setting the flag
> PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE. However when we die due
> to bogus input, the expense of CPU cycles spent outweighs the user
> wondering what went wrong, so run that check unconditionally before
> dying with a more generic error message.
>
> Note: There is a case (e.g. "git -C submodule add .") in which we call
> strip_submodule_slash_expensive, as git-add requests it via the flag
> PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE, but the assert used to
> trigger nevertheless, because the flag PATHSPEC_LITERAL was not set,
> such that we executed
>
> if (item->nowildcard_len < prefixlen)
> item->nowildcard_len = prefixlen;
>
> and prefixlen was not adapted (e.g. it was computed from "submodule/")
> So in the die_inside_submodule_path function we also need handle paths,
> that were stripped before, i.e. are the exact submodule path. This
> is why the conditions in die_inside_submodule_path are slightly
> different than in strip_submodule_slash_expensive.
>
> [1] https://www.google.com/search?q=item-%3Enowildcard_len
> [2] http://git.661346.n2.nabble.com/assert-failed-in-submodule-edge-case-td7628687.html
> https://www.spinics.net/lists/git/msg249473.html
>
> Helped-by: Jeff King <peff@peff.net>
> Helped-by: Junio C Hamano <gitster@pobox.com>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
For future reference, do not bury a useful fix behind unproven new
things. The main purpose of this two-patch series is this change,
and it does not have to wait for the change to allow test_commit to
notice "-C" you have in another series.
Just write it in longhand, and when both topics graduate, send in
another patch to update "(cd <dir> && test_commit <others>)" to use
the new "test_commit -C <dir> <others>".
Thanks.
> pathspec.c | 35 +++++++++++++++++++++++++++++++++--
> t/t6134-pathspec-in-submodule.sh | 33 +++++++++++++++++++++++++++++++++
> 2 files changed, 66 insertions(+), 2 deletions(-)
> create mode 100755 t/t6134-pathspec-in-submodule.sh
>
> diff --git a/pathspec.c b/pathspec.c
> index d4efcf6662..42cd83c235 100644
> --- a/pathspec.c
> +++ b/pathspec.c
> @@ -296,6 +296,27 @@ static void strip_submodule_slash_expensive(struct pathspec_item *item)
> }
> }
>
> +static void die_inside_submodule_path(struct pathspec_item *item)
> +{
> + int i;
> +
> + for (i = 0; i < active_nr; i++) {
> + struct cache_entry *ce = active_cache[i];
> + int ce_len = ce_namelen(ce);
> +
> + if (!S_ISGITLINK(ce->ce_mode))
> + continue;
> +
> + if (item->len < ce_len ||
> + !(item->match[ce_len] == '/' || item->match[ce_len] == '\0') ||
> + memcmp(ce->name, item->match, ce_len))
> + continue;
> +
> + die(_("Pathspec '%s' is in submodule '%.*s'"),
> + item->original, ce_len, ce->name);
> + }
> +}
> +
> /*
> * Perform the initialization of a pathspec_item based on a pathspec element.
> */
> @@ -391,8 +412,18 @@ static void init_pathspec_item(struct pathspec_item *item, unsigned flags,
> }
>
> /* sanity checks, pathspec matchers assume these are sane */
> - assert(item->nowildcard_len <= item->len &&
> - item->prefix <= item->len);
> + if (item->nowildcard_len > item->len ||
> + item->prefix > item->len) {
> + /*
> + * This case can be triggered by the user pointing us to a
> + * pathspec inside a submodule, which is an input error.
> + * Detect that here and complain, but fallback in the
> + * non-submodule case to a BUG, as we have no idea what
> + * would trigger that.
> + */
> + die_inside_submodule_path(item);
> + die ("BUG: item->nowildcard_len > item->len || item->prefix > item->len)");
> + }
> }
>
> static int pathspec_item_cmp(const void *a_, const void *b_)
> diff --git a/t/t6134-pathspec-in-submodule.sh b/t/t6134-pathspec-in-submodule.sh
> new file mode 100755
> index 0000000000..2900d8d06e
> --- /dev/null
> +++ b/t/t6134-pathspec-in-submodule.sh
> @@ -0,0 +1,33 @@
> +#!/bin/sh
> +
> +test_description='test case exclude pathspec'
> +
> +TEST_CREATE_SUBMODULE=yes
> +. ./test-lib.sh
> +
> +test_expect_success 'setup a submodule' '
> + git submodule add ./pretzel.bare sub &&
> + git commit -a -m "add submodule" &&
> + git submodule deinit --all
> +'
> +
> +cat <<EOF >expect
> +fatal: Pathspec 'sub/a' is in submodule 'sub'
> +EOF
> +
> +test_expect_success 'error message for path inside submodule' '
> + echo a >sub/a &&
> + test_must_fail git add sub/a 2>actual &&
> + test_cmp expect actual
> +'
> +
> +cat <<EOF >expect
> +fatal: Pathspec '.' is in submodule 'sub'
> +EOF
> +
> +test_expect_success 'error message for path inside submodule from within submodule' '
> + test_must_fail git -C sub add . 2>actual &&
> + test_cmp expect actual
> +'
> +
> +test_done
^ permalink raw reply
* Re: [PATCHv6 1/2] submodule tests: don't use itself as a submodule
From: Junio C Hamano @ 2017-01-09 2:33 UTC (permalink / raw)
To: Stefan Beller; +Cc: bmwill, peff, git
In-Reply-To: <20170105192904.1107-2-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> This provides an easier way to have submodules in tests, by just setting
> TEST_CREATE_SUBMODULE to a non empty string, similar to
> TEST_NO_CREATE_REPO.
Yuck.
I find it doubtful that it is a good idea to create two submodule
repositories by merely dot-including the test-lib.sh; I find it
doubly doubtful that it is a good idea to make test_create_repo
pay attention to the special variable to implement that.
I am OK with a solution where callers that set TEST_CREATE_SUBMODULE
variable in this patch to instead have an explicit call
test_create_repo --submodule pretzel
That would be a lot more obvious.
The primary reason why I hate the implementation in this patch is
that it is very easy for a test that says TEST_CREATE_SUBMODULE
upfront, only to get the initial test repository (which everybody
else gets) with two test submodules, to later gain a test that wants
to use a separate repository and call "test_create_repo". It will
always get the pretzel submodules, which may or may not match what
the test writer who adds a new test needs.
> Make use of it in those tests that add a submodule from ./. except for
> the occurrence in create_lib_submodule_repo as there it seems we craft
> a repository deliberately for both inside as well as outside use.
But isn't the point of this change that use of ./. cannot be
mimicking any real-world use, hence pointless for the purpose of
really testing the components of the system? If "we craft
deliberately for both inside and outside use" indeed _IS_ a good
thing, then perhaps use of ./. has practical real-world use---if
not, wouldn't we want to fix the scripts that include the
lib-submodule-repo helper not to test such an unrealistic layout?
^ permalink raw reply
* Re: [PATCH v5 00/16] pathspec cleanup
From: Junio C Hamano @ 2017-01-09 2:04 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Brandon Williams, Git Mailing List, Stefan Beller
In-Reply-To: <CACsJy8CM6FfHpVuqby=hjPmiYAxvJjzr1W6LdO5B82KQnTmmog@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
> On Thu, Jan 5, 2017 at 1:03 AM, Brandon Williams <bmwill@google.com> wrote:
>> Changes in v5:
>> * Move GUARD_PATHSPEC to prevent checking if pathspec is null twice.
>> * Mark a string containing 'mnemonic' for translation.
>
> Argh.. I've run out of things to complain about! Ack!
Thanks ;-) Will queue with your reviewed-by.
^ permalink raw reply
* Re: [PATCH 1/2] stash: fix USAGE text
From: Junio C Hamano @ 2017-01-09 1:48 UTC (permalink / raw)
To: Marc Strapetz; +Cc: git
In-Reply-To: <20170103155356.11213-1-marc.strapetz@syntevo.com>
Marc Strapetz <marc.strapetz@syntevo.com> writes:
> Add missing usage description for stash subcommands
> 'create' and 'store'.
I think we didn't add them to usage description when we added them
because these two are not end-user facing commands but for script
writers (who do not use "$ git stash -h <ENTER>" to learn how to
use).
I dunno.
> Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
> ---
> git-stash.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/git-stash.sh b/git-stash.sh
> index 10c284d1a..c6b9db694 100755
> --- a/git-stash.sh
> +++ b/git-stash.sh
> @@ -9,7 +9,9 @@ USAGE="list [<options>]
> or: $dashless branch <branchname> [<stash>]
> or: $dashless [save [--patch] [-k|--[no-]keep-index] [-q|--quiet]
> [-u|--include-untracked] [-a|--all] [<message>]]
> - or: $dashless clear"
> + or: $dashless clear
> + or: $dashless create [<message>]
> + or: $dashless store [-m|--message <message>] [-q|--quiet] <commit>"
>
> SUBDIRECTORY_OK=Yes
> OPTIONS_SPEC=
^ permalink raw reply
* Re: [PATCH v4 4/4] t7800: run both builtin and scripted difftool, for now
From: Junio C Hamano @ 2017-01-09 1:38 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, David Aguilar, Dennis Kaarsemaker, Paul Sbarra
In-Reply-To: <0ae4a950a4cd2c8c4f05a6b46c60f127611580cf.1483373635.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
> This is uglier than a simple
>
> touch "$GIT_EXEC_PATH/use-builtin-difftool"
>
> of course. But oh well.
That is totally irrelevant.
The more important point is that we do the same set of tests so
instead of running just one, we run BOTH. If we did a bit more
work, we could even say "even when there is no Perl installed, we
run tests with only the new built-in one". This does not go that
far yet, but that should not be too hard, I would think. See below.
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index e94910c563..273ab55723 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -23,6 +23,20 @@ prompt_given ()
> test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
> }
>
> +for use_builtin_difftool in false true
> +do
Instead of the above, I'd suggest to make the loop like so:
for use_builtin_difftool in $TESTED_VARIANTS
do
and before the loop begins, set TESTED_VARIANTS to either "false
true" or "true" by checking the PERL prerequisite.
> +test_expect_success 'verify we are running the correct difftool' '
> + if test true = '$use_builtin_difftool'
> + then
> + test_must_fail ok=129 git difftool -h >help &&
> + grep "g, --gui" help
> + else
> + git difftool -h >help &&
> + grep "g|--gui" help
> + fi
> +'
> +
> # NEEDSWORK: lose all the PERL prereqs once legacy-difftool is retired.
And then we can lose this comment. As all existing tests have PERL
prereq that can go away with the above suggested change, we'd need
to touch quite a many lines with "s/_success PERL /_success /".
It may be a good time to indent these existing tests to make it
clear that they are inside the new "for use_builtin_difftool" loop.
> +test true != $use_builtin_difftool || break
> +
> +test_expect_success 'tear down for re-run' '
> + rm -rf * .[a-z]* &&
> + git init
> +'
> +
> +# run as builtin difftool now
> +GIT_CONFIG_PARAMETERS="'difftool.usebuiltin=true'"
> +export GIT_CONFIG_PARAMETERS
... and indentation would extend to these newly added lines, of
course.
> +done
> +
> test_done
^ permalink raw reply
* Re: [PATCH v4 1/4] Avoid Coverity warning about unfree()d git_exec_path()
From: Junio C Hamano @ 2017-01-09 1:25 UTC (permalink / raw)
To: Stefan Beller
Cc: Johannes Schindelin, git@vger.kernel.org, David Aguilar,
Dennis Kaarsemaker, Paul Sbarra
In-Reply-To: <CAGZ79kZ--jp08pK+xwn1N2VQQr8bA5+DveE2HsoY90R1gR6c_A@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
> On Mon, Jan 2, 2017 at 8:22 AM, Johannes Schindelin
> <johannes.schindelin@gmx.de> wrote:
>> Technically, it is correct that git_exec_path() returns a possibly
>> malloc()ed string. Practically, it is *sometimes* not malloc()ed. So
>> let's just use a static variable to make it a singleton. That'll shut
>> Coverity up, hopefully.
>
> I picked up this patch and applied it to the coverity branch
> that I maintain at github/stefanbeller/git.
>
> I'd love to see this patch upstream as it reduces my maintenance
> burden of the coverity branch by a patch.
So with the above, are you saying "Dscho said 'hopefully', and I
confirm that this change does squelch misdiagnosis by Coverity"?
> If this patch is only to appease coverity (as the commit message eludes
> to) I think this may be a bad idea for upstream. If this patch fixes an
> actual problem, then the commit message needs to spell that out.
That is true, and I see Peff pointed out another possible issue
around getenv(), but I think from the "one step at a time" point of
view, it is an improvement to call system_path() just once and cache
it in "static char *".
How about explaining it like this then?
(only the log message has been corrected; diff is from the original).
commit c9bb5d101ca657fa466afa8c4368c43ea7b7aca8
Author: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon Jan 2 17:22:33 2017 +0100
git_exec_path: avoid Coverity warning about unfree()d result
Technically, it is correct that git_exec_path() returns a possibly
malloc()ed string returned from system_path(), and it is sometimes
not allocated. Cache the result in a static variable and make sure
that we call system_path() only once, which plugs a potential leak.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/exec_cmd.c b/exec_cmd.c
index 9d5703a157..eae56fefba 100644
--- a/exec_cmd.c
+++ b/exec_cmd.c
@@ -69,6 +69,7 @@ void git_set_argv_exec_path(const char *exec_path)
const char *git_exec_path(void)
{
const char *env;
+ static char *system_exec_path;
if (argv_exec_path)
return argv_exec_path;
@@ -78,7 +79,9 @@ const char *git_exec_path(void)
return env;
}
- return system_path(GIT_EXEC_PATH);
+ if (!system_exec_path)
+ system_exec_path = system_path(GIT_EXEC_PATH);
+ return system_exec_path;
}
static void add_path(struct strbuf *out, const char *path)
^ permalink raw reply related
* Re: [PATCH] connect: handle putty/plink also in GIT_SSH_COMMAND
From: Junio C Hamano @ 2017-01-09 1:08 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, Segev Finer
In-Reply-To: <xmqqy3ym1dsc.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
> I suspect that this will break when GIT_SSH_COMMAND, which is meant
> to be processed by the shell, hence the user can write anything,
> begins with a one-shot environment variable assignment, e.g.
>
> [core] sshcommand = VAR1=VAL1 VAR2=VAL2 //path/to/tortoiseplink
>
> One possible unintended side effect of this patch is when VAL1 ends
> with /plink (or /tortoiseplink) and the command is not either of
> these, in which case the "tortoiseplink" and "putty" variables will
> tweak the command line for an SSH implementation that does not want
> such a tweak to be made. There may be other unintended fallouts.
Thinking about this further, as the sshcommand (or GIT_SSH_COMMAND)
interface takes any shell-interpretable commands, the first "token"
you see is not limited to a one-shot environment assignment. It
could even be "cmd1 && cmd2 && ..." or even:
if test -f ${TPLINK:=//path/to/tortoiseplink}
then
exec "$TPLINK" "$@"
elif test -f ${PLINK:=//path/to/plink}
exec "$PLINK" "$@"
else
echo >&2 no usable ssh on this host
fi
Worse, the above may be in "myssh" script found on user's PATH and
then core.sshcommand may be set to
TPLINK=//my/path/to/tortoiseplink PLINK=//my/path/to/plink myssh
in the configuration the user uses on multiple hosts, some have
tortoiseplink installed and some do not. The idea the user who set
it up may be to use whatever available depending on the host.
The posted patch would be confused that we are using tortoiseplink
but the "myssh" script would correctly notice that on a particular
host it is unavailable and choose to use plink instead.
> Sorry, no concrete suggestion to get this to work comes to my mind
> offhand.
>
> Perhaps give an explicit way to force "tortoiseplink" and "putty"
> variables without looking at and guessing from the pathname, so that
> the solution does not have to split and peek the command line?
A user with such an elaborate set-up with multiple hosts with
different configurations would likely to want to say "Just give me a
regular SSH command line, and in my 'myssh' script I'll futz with
-p/-P differences and such, as I'm writing a small script to cope
with Tortoiseplink and Puttyplink anyway". With a separate,
explicit configuration variable to tell Git what variant of SSH you
have, even such a user can be served (she would just set ssh.variant
to "vanilla" or whatever that is not "tortoiseplink" or "plink").
.
^ permalink raw reply
* Re: [PATCH v1] convert: add "status=delayed" to filter process protocol
From: Junio C Hamano @ 2017-01-08 23:42 UTC (permalink / raw)
To: larsxschneider; +Cc: git, e, jnareb
In-Reply-To: <20170108191736.47359-1-larsxschneider@gmail.com>
larsxschneider@gmail.com writes:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> Some `clean` / `smudge` filters might require a significant amount of
> time to process a single blob. During this process the Git checkout
> operation is blocked and Git needs to wait until the filter is done to
> continue with the checkout.
>
> Teach the filter process protocol (introduced in edcc858) to accept the
> status "delayed" as response to a filter request. Upon this response Git
> continues with the checkout operation and asks the filter to process the
> blob again after all other blobs have been processed.
Hmm, I would have expected that the basic flow would become
for each paths to be processed:
convert-to-worktree to buf
if not delayed:
do the caller's thing to use buf
else:
remember path
for each delayed paths:
ensure filter process finished processing for path
fetch the thing to buf from the process
do the caller's thing to use buf
and that would make quite a lot of sense. However, what is actually
implemented is a bit disappointing from that point of view. While
its first part is the same as above, the latter part instead does:
for each delayed paths:
checkout the path
Presumably, checkout_entry() does the "ensure that the process is
done converting" (otherwise the result is simply buggy), but what
disappoints me is that this does not allow callers that call
"convert-to-working-tree", whose interface is obtain the bytestream
in-core in the working tree representation, given an object in the
object-db representation in an in-core buffer, to _use_ the result
of the conversion. The caller does not have a chance to even see
the result as it is written straight to the filesystem, once it
calls checkout_delayed_entries().
^ permalink raw reply
* Re: [PATCH v1] convert: add "status=delayed" to filter process protocol
From: Eric Wong @ 2017-01-08 20:45 UTC (permalink / raw)
To: larsxschneider; +Cc: git, gitster, jnareb
In-Reply-To: <20170108191736.47359-1-larsxschneider@gmail.com>
larsxschneider@gmail.com wrote:
> +++ b/t/t0021/rot13-filter.pl
> +$DELAY{'test-delay1.r'} = 1;
> +$DELAY{'test-delay3.r'} = 3;
>
> open my $debug, ">>", "rot13-filter.log" or die "cannot open log file: $!";
>
> @@ -166,6 +176,15 @@ while (1) {
> packet_txt_write("status=abort");
> packet_flush();
> }
> + elsif ( $command eq "smudge" and
> + exists $DELAY{$pathname} and
> + $DELAY{$pathname} gt 0 ) {
Use '>' for numeric comparisons. 'gt' is for strings (man perlop)
Sidenote, staying <= 80 columns for the rest of the changes is
strongly preferred, some of us need giant fonts. I think what
Torsten said about introducing a new *_internal function can
also help with that.
Thanks.
^ permalink raw reply
* Re: [PATCH v1] convert: add "status=delayed" to filter process protocol
From: Torsten Bögershausen @ 2017-01-08 20:14 UTC (permalink / raw)
To: larsxschneider; +Cc: git, gitster, e, jnareb
In-Reply-To: <20170108191736.47359-1-larsxschneider@gmail.com>
On Sun, Jan 08, 2017 at 08:17:36PM +0100, larsxschneider@gmail.com wrote:
> From: Lars Schneider <larsxschneider@gmail.com>
>
> Some `clean` / `smudge` filters might require a significant amount of
> time to process a single blob. During this process the Git checkout
> operation is blocked and Git needs to wait until the filter is done to
> continue with the checkout.
>
> Teach the filter process protocol (introduced in edcc858) to accept the
> status "delayed" as response to a filter request. Upon this response Git
> continues with the checkout operation and asks the filter to process the
> blob again after all other blobs have been processed.
>
> Git has a multiple code paths that checkout a blob. Support delayed
> checkouts only in `clone` (in unpack-trees.c) and `checkout` operations.
>
> Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
> ---
>
Some feeling tells me that it may be better to leave convert_to_working_tree() as it is.
And change convert_to_working_tree_internal as suggested:
int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst)
{
- return convert_to_working_tree_internal(path, src, len, dst, 0);
+ return convert_to_working_tree_internal(path, src, len, dst, NULL, 0);
}
^ permalink raw reply
* [PATCH v1] convert: add "status=delayed" to filter process protocol
From: larsxschneider @ 2017-01-08 19:17 UTC (permalink / raw)
To: git; +Cc: gitster, e, jnareb, Lars Schneider
From: Lars Schneider <larsxschneider@gmail.com>
Some `clean` / `smudge` filters might require a significant amount of
time to process a single blob. During this process the Git checkout
operation is blocked and Git needs to wait until the filter is done to
continue with the checkout.
Teach the filter process protocol (introduced in edcc858) to accept the
status "delayed" as response to a filter request. Upon this response Git
continues with the checkout operation and asks the filter to process the
blob again after all other blobs have been processed.
Git has a multiple code paths that checkout a blob. Support delayed
checkouts only in `clone` (in unpack-trees.c) and `checkout` operations.
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
---
You can find the RFC thread for this topic here:
http://public-inbox.org/git/D10F7C47-14E8-465B-8B7A-A09A1B28A39F@gmail.com/
Notes:
Base Commit: e05806da9e (master)
Diff on Web: https://github.com/larsxschneider/git/commit/ea25a1834b
Checkout: git fetch https://github.com/larsxschneider/git filter-process/delay-v1 && git checkout ea25a1834b
Interdiff (filter-process/delay-v0..filter-process/delay-v1):
Documentation/gitattributes.txt | 9 +++++++
apply.c | 2 +-
archive.c | 2 +-
builtin/cat-file.c | 2 +-
builtin/checkout.c | 1 +
cache.h | 1 +
convert.c | 33 ++++++++++++++-----------
convert.h | 2 +-
diff.c | 2 +-
entry.c | 40 +++++++++++++++++++++++++++----
merge-recursive.c | 2 +-
t/t0021-conversion.sh | 53 +++++++++++++++++++++++++++++++++++++++++
t/t0021/rot13-filter.pl | 19 +++++++++++++++
unpack-trees.c | 1 +
14 files changed, 145 insertions(+), 24 deletions(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index e0b66c1220..f6bad8db40 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -473,6 +473,15 @@ packet: git< 0000 # empty content!
packet: git< 0000 # empty list, keep "status=success" unchanged!
------------------------
+If the request cannot be fulfilled within a reasonable amount of time
+then the filter can respond with a "delayed" status and a flush packet.
+Git will perform the same request at a later point in time, again. The
+filter can delay a response multiple times for a single request.
+------------------------
+packet: git< status=delayed
+packet: git< 0000
+------------------------
+
In case the filter cannot or does not want to process the content,
it is expected to respond with an "error" status.
------------------------
diff --git a/apply.c b/apply.c
index 2ed808d429..aa7e6e4359 100644
--- a/apply.c
+++ b/apply.c
@@ -4328,7 +4328,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
if (fd < 0)
return 1;
- if (convert_to_working_tree(path, buf, size, &nbuf)) {
+ if (convert_to_working_tree(path, buf, size, &nbuf, NULL)) {
size = nbuf.len;
buf = nbuf.buf;
}
diff --git a/archive.c b/archive.c
index 01751e574b..90d02463ef 100644
--- a/archive.c
+++ b/archive.c
@@ -77,7 +77,7 @@ void *sha1_file_to_archive(const struct archiver_args *args,
size_t size = 0;
strbuf_attach(&buf, buffer, *sizep, *sizep + 1);
- convert_to_working_tree(path, buf.buf, buf.len, &buf);
+ convert_to_working_tree(path, buf.buf, buf.len, &buf, NULL);
if (commit)
format_subst(commit, buf.buf, buf.len, &buf);
buffer = strbuf_detach(&buf, &size);
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 30383e9eb4..4e3e31a00b 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -35,7 +35,7 @@ static int filter_object(const char *path, unsigned mode,
oid_to_hex(oid), path);
if ((type == OBJ_BLOB) && S_ISREG(mode)) {
struct strbuf strbuf = STRBUF_INIT;
- if (convert_to_working_tree(path, *buf, *size, &strbuf)) {
+ if (convert_to_working_tree(path, *buf, *size, &strbuf, NULL)) {
free(*buf);
*size = strbuf.len;
*buf = strbuf_detach(&strbuf, NULL);
diff --git a/builtin/checkout.c b/builtin/checkout.c
index bfe685c198..42885cfe92 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -369,6 +369,7 @@ static int checkout_paths(const struct checkout_opts *opts,
pos = skip_same_name(ce, pos) - 1;
}
}
+ errs |= checkout_delayed_entries(&state);
if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
die(_("unable to write new index file"));
diff --git a/cache.h b/cache.h
index a50a61a197..5d119ffc6b 100644
--- a/cache.h
+++ b/cache.h
@@ -1375,6 +1375,7 @@ struct checkout {
#define TEMPORARY_FILENAME_LENGTH 25
extern int checkout_entry(struct cache_entry *ce, const struct checkout *state, char *topath);
+extern int checkout_delayed_entries(const struct checkout *state);
struct cache_def {
struct strbuf path;
diff --git a/convert.c b/convert.c
index 4e17e45ed2..4075a58e64 100644
--- a/convert.c
+++ b/convert.c
@@ -672,7 +672,7 @@ static struct cmd2process *start_multi_file_filter(struct hashmap *hashmap, cons
}
static int apply_multi_file_filter(const char *path, const char *src, size_t len,
- int fd, struct strbuf *dst, const char *cmd,
+ int fd, struct strbuf *dst, int *delayed, const char *cmd,
const unsigned int wanted_capability)
{
int err;
@@ -738,9 +738,14 @@ static int apply_multi_file_filter(const char *path, const char *src, size_t len
goto done;
read_multi_file_filter_status(process->out, &filter_status);
- err = strcmp(filter_status.buf, "success");
- if (err)
+ if (delayed && !strcmp(filter_status.buf, "delayed")) {
+ *delayed = 1;
goto done;
+ } else {
+ err = strcmp(filter_status.buf, "success");
+ if (err)
+ goto done;
+ }
err = read_packetized_to_strbuf(process->out, &nbuf) < 0;
if (err)
@@ -787,8 +792,8 @@ static struct convert_driver {
} *user_convert, **user_convert_tail;
static int apply_filter(const char *path, const char *src, size_t len,
- int fd, struct strbuf *dst, struct convert_driver *drv,
- const unsigned int wanted_capability)
+ int fd, struct strbuf *dst, int *delayed,
+ struct convert_driver *drv, const unsigned int wanted_capability)
{
const char *cmd = NULL;
@@ -806,7 +811,7 @@ static int apply_filter(const char *path, const char *src, size_t len,
if (cmd && *cmd)
return apply_single_file_filter(path, src, len, fd, dst, cmd);
else if (drv->process && *drv->process)
- return apply_multi_file_filter(path, src, len, fd, dst, drv->process, wanted_capability);
+ return apply_multi_file_filter(path, src, len, fd, dst, delayed, drv->process, wanted_capability);
return 0;
}
@@ -1152,7 +1157,7 @@ int would_convert_to_git_filter_fd(const char *path)
if (!ca.drv->required)
return 0;
- return apply_filter(path, NULL, 0, -1, NULL, ca.drv, CAP_CLEAN);
+ return apply_filter(path, NULL, 0, -1, NULL, NULL, ca.drv, CAP_CLEAN);
}
const char *get_convert_attr_ascii(const char *path)
@@ -1189,7 +1194,7 @@ int convert_to_git(const char *path, const char *src, size_t len,
convert_attrs(&ca, path);
- ret |= apply_filter(path, src, len, -1, dst, ca.drv, CAP_CLEAN);
+ ret |= apply_filter(path, src, len, -1, dst, NULL, ca.drv, CAP_CLEAN);
if (!ret && ca.drv && ca.drv->required)
die("%s: clean filter '%s' failed", path, ca.drv->name);
@@ -1214,7 +1219,7 @@ void convert_to_git_filter_fd(const char *path, int fd, struct strbuf *dst,
assert(ca.drv);
assert(ca.drv->clean || ca.drv->process);
- if (!apply_filter(path, NULL, 0, fd, dst, ca.drv, CAP_CLEAN))
+ if (!apply_filter(path, NULL, 0, fd, dst, NULL, ca.drv, CAP_CLEAN))
die("%s: clean filter '%s' failed", path, ca.drv->name);
crlf_to_git(path, dst->buf, dst->len, dst, ca.crlf_action, checksafe);
@@ -1222,7 +1227,7 @@ void convert_to_git_filter_fd(const char *path, int fd, struct strbuf *dst,
}
static int convert_to_working_tree_internal(const char *path, const char *src,
- size_t len, struct strbuf *dst,
+ size_t len, struct strbuf *dst, int *delayed,
int normalizing)
{
int ret = 0, ret_filter = 0;
@@ -1248,21 +1253,21 @@ static int convert_to_working_tree_internal(const char *path, const char *src,
}
}
- ret_filter = apply_filter(path, src, len, -1, dst, ca.drv, CAP_SMUDGE);
+ ret_filter = apply_filter(path, src, len, -1, dst, delayed, ca.drv, CAP_SMUDGE);
if (!ret_filter && ca.drv && ca.drv->required)
die("%s: smudge filter %s failed", path, ca.drv->name);
return ret | ret_filter;
}
-int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst)
+int convert_to_working_tree(const char *path, const char *src, size_t len, struct strbuf *dst, int *delayed)
{
- return convert_to_working_tree_internal(path, src, len, dst, 0);
+ return convert_to_working_tree_internal(path, src, len, dst, delayed, 0);
}
int renormalize_buffer(const char *path, const char *src, size_t len, struct strbuf *dst)
{
- int ret = convert_to_working_tree_internal(path, src, len, dst, 1);
+ int ret = convert_to_working_tree_internal(path, src, len, dst, NULL, 1);
if (ret) {
src = dst->buf;
len = dst->len;
diff --git a/convert.h b/convert.h
index 82871a11d5..72f24078de 100644
--- a/convert.h
+++ b/convert.h
@@ -41,7 +41,7 @@ extern const char *get_convert_attr_ascii(const char *path);
extern int convert_to_git(const char *path, const char *src, size_t len,
struct strbuf *dst, enum safe_crlf checksafe);
extern int convert_to_working_tree(const char *path, const char *src,
- size_t len, struct strbuf *dst);
+ size_t len, struct strbuf *dst, int *delayed);
extern int renormalize_buffer(const char *path, const char *src, size_t len,
struct strbuf *dst);
static inline int would_convert_to_git(const char *path)
diff --git a/diff.c b/diff.c
index 84dba60c40..243cd0ffdf 100644
--- a/diff.c
+++ b/diff.c
@@ -2960,7 +2960,7 @@ static void prep_temp_blob(const char *path, struct diff_tempfile *temp,
if (fd < 0)
die_errno("unable to create temp-file");
if (convert_to_working_tree(path,
- (const char *)blob, (size_t)size, &buf)) {
+ (const char *)blob, (size_t)size, &buf, NULL)) {
blob = buf.buf;
size = buf.len;
}
diff --git a/entry.c b/entry.c
index c6eea240b6..43f3ae7b69 100644
--- a/entry.c
+++ b/entry.c
@@ -2,6 +2,14 @@
#include "blob.h"
#include "dir.h"
#include "streaming.h"
+#include "list.h"
+
+static LIST_HEAD(delayed_cache_entry_queue_head);
+
+struct delayed_cache_entry {
+ struct cache_entry *ce;
+ struct list_head node;
+};
static void create_directories(const char *path, int path_len,
const struct checkout *state)
@@ -140,12 +148,13 @@ static int write_entry(struct cache_entry *ce,
char *path, const struct checkout *state, int to_tempfile)
{
unsigned int ce_mode_s_ifmt = ce->ce_mode & S_IFMT;
- int fd, ret, fstat_done = 0;
+ int fd, ret, fstat_done = 0, delayed = 0;
char *new;
struct strbuf buf = STRBUF_INIT;
unsigned long size;
size_t wrote, newsize = 0;
struct stat st;
+ struct delayed_cache_entry *delayed_ce;
if (ce_mode_s_ifmt == S_IFREG) {
struct stream_filter *filter = get_stream_filter(ce->name,
@@ -178,10 +187,17 @@ static int write_entry(struct cache_entry *ce,
* Convert from git internal format to working tree format
*/
if (ce_mode_s_ifmt == S_IFREG &&
- convert_to_working_tree(ce->name, new, size, &buf)) {
+ convert_to_working_tree(ce->name, new, size, &buf, &delayed)) {
free(new);
- new = strbuf_detach(&buf, &newsize);
- size = newsize;
+ if (delayed) {
+ delayed_ce = xmalloc(sizeof(*delayed_ce));
+ delayed_ce->ce = ce;
+ list_add_tail(&delayed_ce->node, &delayed_cache_entry_queue_head);
+ goto finish;
+ } else {
+ new = strbuf_detach(&buf, &newsize);
+ size = newsize;
+ }
}
fd = open_output_fd(path, ce, to_tempfile);
@@ -291,3 +307,19 @@ int checkout_entry(struct cache_entry *ce,
create_directories(path.buf, path.len, state);
return write_entry(ce, path.buf, state, 0);
}
+
+int checkout_delayed_entries(const struct checkout *state)
+{
+ struct delayed_cache_entry *head;
+ int errs = 0;
+
+ while (!list_empty(&delayed_cache_entry_queue_head)) {
+ head = list_first_entry(&delayed_cache_entry_queue_head,
+ struct delayed_cache_entry, node);
+ list_del(&head->node);
+ head->ce->ce_flags &= ~CE_UPDATE;
+ errs |= checkout_entry(head->ce, state, NULL);
+ }
+
+ return errs;
+}
diff --git a/merge-recursive.c b/merge-recursive.c
index d327209443..73dd33e61f 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -807,7 +807,7 @@ static int update_file_flags(struct merge_options *o,
}
if (S_ISREG(mode)) {
struct strbuf strbuf = STRBUF_INIT;
- if (convert_to_working_tree(path, buf, size, &strbuf)) {
+ if (convert_to_working_tree(path, buf, size, &strbuf, NULL)) {
free(buf);
size = strbuf.len;
buf = strbuf_detach(&strbuf, NULL);
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 161f560446..8ae5b1a521 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -701,4 +701,57 @@ test_expect_success PERL 'invalid process filter must fail (and not hang!)' '
)
'
+test_expect_success PERL 'delayed checkout in process filter' '
+ test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
+ test_config_global filter.protocol.required true &&
+ rm -rf repo &&
+ mkdir repo &&
+ (
+ cd repo &&
+ git init &&
+ echo "*.r filter=protocol" >.gitattributes &&
+ cp "$TEST_ROOT/test.o" test.r &&
+ cp "$TEST_ROOT/test.o" test-delay1.r &&
+ cp "$TEST_ROOT/test.o" test-delay3.r &&
+ git add . &&
+ git commit -m "test commit 1"
+ ) &&
+
+ S=$(file_size repo/test.r) &&
+ rm -rf repo-cloned &&
+ filter_git clone repo repo-cloned &&
+ cat >expected.log <<-EOF &&
+ START
+ init handshake complete
+ IN: smudge test.r $S [OK] -- OUT: $S . [OK]
+ IN: smudge test-delay1.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay1.r $S [OK] -- OUT: $S . [OK]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S . [OK]
+ STOP
+ EOF
+ test_cmp_count expected.log repo-cloned/rot13-filter.log &&
+
+ (
+ cd repo-cloned &&
+ rm *.r rot13-filter.log &&
+ filter_git checkout . &&
+ cat >expected.log <<-EOF &&
+ START
+ init handshake complete
+ IN: smudge test.r $S [OK] -- OUT: $S . [OK]
+ IN: smudge test-delay1.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay1.r $S [OK] -- OUT: $S . [OK]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S [DELAYED]
+ IN: smudge test-delay3.r $S [OK] -- OUT: $S . [OK]
+ STOP
+ EOF
+ test_cmp_count expected.log rot13-filter.log
+ )
+'
+
test_done
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index 617f581e56..b10be1e543 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -17,6 +17,10 @@
# operation then the filter signals that it cannot or does not want
# to process the file and any file after that is processed with the
# same command.
+# (5) If data with a pathname that is a key in the DELAY hash is
+# processed (e.g. 'test-delay1.r') then the filter signals n times
+# to Git that the processing is delayed (n being the value of the
+# DELAY hash key).
#
use strict;
@@ -25,6 +29,12 @@ use IO::File;
my $MAX_PACKET_CONTENT_SIZE = 65516;
my @capabilities = @ARGV;
+my $DELAY3 = 3;
+my $DELAY1 = 1;
+
+my %DELAY;
+$DELAY{'test-delay1.r'} = 1;
+$DELAY{'test-delay3.r'} = 3;
open my $debug, ">>", "rot13-filter.log" or die "cannot open log file: $!";
@@ -166,6 +176,15 @@ while (1) {
packet_txt_write("status=abort");
packet_flush();
}
+ elsif ( $command eq "smudge" and
+ exists $DELAY{$pathname} and
+ $DELAY{$pathname} gt 0 ) {
+ $DELAY{$pathname} = $DELAY{$pathname} - 1;
+ print $debug "[DELAYED]\n";
+ $debug->flush();
+ packet_txt_write("status=delayed");
+ packet_flush();
+ }
else {
packet_txt_write("status=success");
packet_flush();
diff --git a/unpack-trees.c b/unpack-trees.c
index 7a6df99d10..662b75f72a 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -268,6 +268,7 @@ static int check_updates(struct unpack_trees_options *o,
}
}
}
+ errs |= checkout_delayed_entries(state);
stop_progress(&progress);
if (o->update)
git_attr_set_direction(GIT_ATTR_CHECKIN, NULL);
--
2.11.0
^ permalink raw reply related
* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
From: Johannes Schindelin @ 2017-01-08 18:54 UTC (permalink / raw)
To: Steven Penny; +Cc: git
In-Reply-To: <CAAXzdLVXUdCAcJL6DratNwLFUSN4UAV+TmALSZe-zSSTAJcWWw@mail.gmail.com>
Hi Steven,
On Sun, 8 Jan 2017, Steven Penny wrote:
> On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
> > I am curious: how do you build Git? I ask because I build Git on Windows
> > many times a day, and I did not encounter any link problems.
>
> My end goal is to build static native Windows Git via Cygwin and the
> mingw64-x86_64-gcc-core package.
That is certainly a worthy goal, and I would highly recommend to mention
that particular cross-compiling setup in the commit message. It's not like
this is the easiest way to build native Git on Windows...
Ciao,
Johannes
^ permalink raw reply
* [PATCH v4 2/2] t9813: avoid using pipes
From: Pranit Bauva @ 2017-01-08 16:55 UTC (permalink / raw)
To: git
In-Reply-To: <010201597f017978-356bf9e9-ee78-498b-926b-5c00466b1d9e-000000@eu-west-1.amazonses.com>
The exit code of the upstream in a pipe is ignored thus we should avoid
using it. By writing out the output of the git command to a file, we can
test the exit codes of both the commands.
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
t/t9813-git-p4-preserve-users.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh
index 76004a5..bda222a 100755
--- a/t/t9813-git-p4-preserve-users.sh
+++ b/t/t9813-git-p4-preserve-users.sh
@@ -118,12 +118,12 @@ test_expect_success 'not preserving user with mixed authorship' '
make_change_by_user usernamefile3 Derek derek@example.com &&
P4EDITOR=cat P4USER=alice P4PASSWD=secret &&
export P4EDITOR P4USER P4PASSWD &&
- git p4 commit |\
- grep "git author derek@example.com does not match" &&
+ git p4 commit >actual &&
+ grep "git author derek@example.com does not match" actual &&
make_change_by_user usernamefile3 Charlie charlie@example.com &&
- git p4 commit |\
- grep "git author charlie@example.com does not match" &&
+ git p4 commit >actual &&
+ grep "git author charlie@example.com does not match" actual &&
make_change_by_user usernamefile3 alice alice@example.com &&
git p4 commit >actual &&
--
https://github.com/git/git/pull/314
^ permalink raw reply related
* [PATCH v4 1/2] don't use test_must_fail with grep
From: Pranit Bauva @ 2017-01-08 16:55 UTC (permalink / raw)
To: git
In-Reply-To: <20170103195708.15157-1-pranit.bauva@gmail.com>
test_must_fail should only be used for testing git commands. To test the
failure of other commands use `!`.
Reported-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
---
t/t3510-cherry-pick-sequence.sh | 6 +++---
t/t5504-fetch-receive-strict.sh | 2 +-
t/t5516-fetch-push.sh | 2 +-
t/t5601-clone.sh | 2 +-
t/t6030-bisect-porcelain.sh | 2 +-
t/t7610-mergetool.sh | 2 +-
t/t9001-send-email.sh | 2 +-
t/t9117-git-svn-init-clone.sh | 12 ++++++------
t/t9813-git-p4-preserve-users.sh | 8 ++++----
t/t9814-git-p4-rename.sh | 6 +++---
10 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh
index 372307c..0acf4b1 100755
--- a/t/t3510-cherry-pick-sequence.sh
+++ b/t/t3510-cherry-pick-sequence.sh
@@ -385,7 +385,7 @@ test_expect_success '--continue respects opts' '
git cat-file commit HEAD~1 >picked_msg &&
git cat-file commit HEAD~2 >unrelatedpick_msg &&
git cat-file commit HEAD~3 >initial_msg &&
- test_must_fail grep "cherry picked from" initial_msg &&
+ ! grep "cherry picked from" initial_msg &&
grep "cherry picked from" unrelatedpick_msg &&
grep "cherry picked from" picked_msg &&
grep "cherry picked from" anotherpick_msg
@@ -426,9 +426,9 @@ test_expect_failure '--signoff is automatically propagated to resolved conflict'
git cat-file commit HEAD~1 >picked_msg &&
git cat-file commit HEAD~2 >unrelatedpick_msg &&
git cat-file commit HEAD~3 >initial_msg &&
- test_must_fail grep "Signed-off-by:" initial_msg &&
+ ! grep "Signed-off-by:" initial_msg &&
grep "Signed-off-by:" unrelatedpick_msg &&
- test_must_fail grep "Signed-off-by:" picked_msg &&
+ ! grep "Signed-off-by:" picked_msg &&
grep "Signed-off-by:" anotherpick_msg
'
diff --git a/t/t5504-fetch-receive-strict.sh b/t/t5504-fetch-receive-strict.sh
index 9b19cff..49d3621 100755
--- a/t/t5504-fetch-receive-strict.sh
+++ b/t/t5504-fetch-receive-strict.sh
@@ -152,7 +152,7 @@ test_expect_success 'push with receive.fsck.missingEmail=warn' '
git --git-dir=dst/.git config --add \
receive.fsck.badDate warn &&
git push --porcelain dst bogus >act 2>&1 &&
- test_must_fail grep "missingEmail" act
+ ! grep "missingEmail" act
'
test_expect_success \
diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh
index 26b2caf..0fc5a7c 100755
--- a/t/t5516-fetch-push.sh
+++ b/t/t5516-fetch-push.sh
@@ -1004,7 +1004,7 @@ test_expect_success 'push --porcelain' '
test_expect_success 'push --porcelain bad url' '
mk_empty testrepo &&
test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
- test_must_fail grep -q Done .git/bar
+ ! grep -q Done .git/bar
'
test_expect_success 'push --porcelain rejected' '
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index a433394..4241ea5 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -151,7 +151,7 @@ test_expect_success 'clone --mirror does not repeat tags' '
git clone --mirror src mirror2 &&
(cd mirror2 &&
git show-ref 2> clone.err > clone.out) &&
- test_must_fail grep Duplicate mirror2/clone.err &&
+ ! grep Duplicate mirror2/clone.err &&
grep some-tag mirror2/clone.out
'
diff --git a/t/t6030-bisect-porcelain.sh b/t/t6030-bisect-porcelain.sh
index 5e5370f..8c2c6ea 100755
--- a/t/t6030-bisect-porcelain.sh
+++ b/t/t6030-bisect-porcelain.sh
@@ -407,7 +407,7 @@ test_expect_success 'good merge base when good and bad are siblings' '
test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
grep $HASH4 my_bisect_log.txt &&
git bisect good > my_bisect_log.txt &&
- test_must_fail grep "merge base must be tested" my_bisect_log.txt &&
+ ! grep "merge base must be tested" my_bisect_log.txt &&
grep $HASH6 my_bisect_log.txt &&
git bisect reset
'
diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 63d36fb..0fe7e58 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -602,7 +602,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
test_config mergetool.myecho.trustExitCode true &&
test_must_fail git merge master &&
git mergetool --no-prompt --tool myecho -- both >actual &&
- test_must_fail grep ^\./both_LOCAL_ actual >/dev/null &&
+ ! grep ^\./both_LOCAL_ actual >/dev/null &&
grep /both_LOCAL_ actual >/dev/null &&
git reset --hard master >/dev/null 2>&1
'
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 3dc4a34..0f398dd 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -50,7 +50,7 @@ test_no_confirm () {
--smtp-server="$(pwd)/fake.sendmail" \
$@ \
$patches >stdout &&
- test_must_fail grep "Send this email" stdout &&
+ ! grep "Send this email" stdout &&
>no_confirm_okay
}
diff --git a/t/t9117-git-svn-init-clone.sh b/t/t9117-git-svn-init-clone.sh
index 69a6750..044f65e 100755
--- a/t/t9117-git-svn-init-clone.sh
+++ b/t/t9117-git-svn-init-clone.sh
@@ -55,7 +55,7 @@ test_expect_success 'clone to target directory with --stdlayout' '
test_expect_success 'init without -s/-T/-b/-t does not warn' '
test ! -d trunk &&
git svn init "$svnrepo"/project/trunk trunk 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
rm -rf trunk &&
rm -f warning
'
@@ -63,7 +63,7 @@ test_expect_success 'init without -s/-T/-b/-t does not warn' '
test_expect_success 'clone without -s/-T/-b/-t does not warn' '
test ! -d trunk &&
git svn clone "$svnrepo"/project/trunk 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
rm -rf trunk &&
rm -f warning
'
@@ -86,7 +86,7 @@ EOF
test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
test ! -d project &&
git svn init -s "$svnrepo"/project project 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
test_svn_configured_prefix "origin/" &&
rm -rf project &&
rm -f warning
@@ -95,7 +95,7 @@ test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
test ! -d project &&
git svn clone -s "$svnrepo"/project 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
test_svn_configured_prefix "origin/" &&
rm -rf project &&
rm -f warning
@@ -104,7 +104,7 @@ test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
test ! -d project &&
git svn init -s "$svnrepo"/project project --prefix "" 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
test_svn_configured_prefix "" &&
rm -rf project &&
rm -f warning
@@ -113,7 +113,7 @@ test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
test ! -d project &&
git svn clone -s "$svnrepo"/project --prefix "" 2>warning &&
- test_must_fail grep -q prefix warning &&
+ ! grep -q prefix warning &&
test_svn_configured_prefix "" &&
rm -rf project &&
rm -f warning
diff --git a/t/t9813-git-p4-preserve-users.sh b/t/t9813-git-p4-preserve-users.sh
index 0fe2312..76004a5 100755
--- a/t/t9813-git-p4-preserve-users.sh
+++ b/t/t9813-git-p4-preserve-users.sh
@@ -126,13 +126,13 @@ test_expect_success 'not preserving user with mixed authorship' '
grep "git author charlie@example.com does not match" &&
make_change_by_user usernamefile3 alice alice@example.com &&
- git p4 commit |\
- test_must_fail grep "git author.*does not match" &&
+ git p4 commit >actual &&
+ ! grep "git author.*does not match" actual &&
git config git-p4.skipUserNameCheck true &&
make_change_by_user usernamefile3 Charlie charlie@example.com &&
- git p4 commit |\
- test_must_fail grep "git author.*does not match" &&
+ git p4 commit >actual &&
+ ! grep "git author.*does not match" actual &&
p4_check_commit_author usernamefile3 alice
)
diff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh
index c89992c..e7e0268 100755
--- a/t/t9814-git-p4-rename.sh
+++ b/t/t9814-git-p4-rename.sh
@@ -141,7 +141,7 @@ test_expect_success 'detect copies' '
git diff-tree -r -C HEAD &&
git p4 submit &&
p4 filelog //depot/file8 &&
- p4 filelog //depot/file8 | test_must_fail grep -q "branch from" &&
+ ! p4 filelog //depot/file8 | grep -q "branch from" &&
echo "file9" >>file2 &&
git commit -a -m "Differentiate file2" &&
@@ -154,7 +154,7 @@ test_expect_success 'detect copies' '
git config git-p4.detectCopies true &&
git p4 submit &&
p4 filelog //depot/file9 &&
- p4 filelog //depot/file9 | test_must_fail grep -q "branch from" &&
+ ! p4 filelog //depot/file9 | grep -q "branch from" &&
echo "file10" >>file2 &&
git commit -a -m "Differentiate file2" &&
@@ -202,7 +202,7 @@ test_expect_success 'detect copies' '
git config git-p4.detectCopies $(($level + 2)) &&
git p4 submit &&
p4 filelog //depot/file12 &&
- p4 filelog //depot/file12 | test_must_fail grep -q "branch from" &&
+ ! p4 filelog //depot/file12 | grep -q "branch from" &&
echo "file13" >>file2 &&
git commit -a -m "Differentiate file2" &&
--
https://github.com/git/git/pull/314
^ permalink raw reply related
* Re: [PATCH] don't use test_must_fail with grep
From: Pranit Bauva @ 2017-01-08 16:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Sixt, Luke Diamand, Git Users, Stefan Beller
In-Reply-To: <xmqqy3ym36y2.fsf@gitster.mtv.corp.google.com>
Hey Junio,
On Sun, Jan 8, 2017 at 2:48 AM, Junio C Hamano <gitster@pobox.com> wrote:
> I see v3 that has 2>&1 but according to Luke's comment ("the message
> comes from cat"), it shouldn't be there? I am behind clearing the
> backlog in my mailbox and I could tweak it out from v3 while
> queuing, or I may forget about it after looking at other topics ;-)
> in which case you may want to send v4 with the fix?
Yeah sure! No problem! :)
Regards,
Pranit Bauva
^ permalink raw reply
* Re: [PATCH] Makefile: put LIBS after LDFLAGS for imap-send
From: Steven Penny @ 2017-01-08 15:12 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
In-Reply-To: <alpine.DEB.2.20.1701081250580.3469@virtualbox>
On Sun, Jan 8, 2017 at 5:54 AM, Johannes Schindelin wrote:
> I am curious: how do you build Git? I ask because I build Git on Windows
> many times a day, and I did not encounter any link problems.
My end goal is to build static native Windows Git via Cygwin and the
mingw64-x86_64-gcc-core package. This is certainly possible but definitely not
considered in the current Git codebase. I have a patch to config.mak.uname
coming as well.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox