* Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to
From: Johannes Schindelin @ 2008-06-26 12:09 UTC (permalink / raw)
To: Matthieu Moy; +Cc: Theodore Tso, git
In-Reply-To: <vpqy74scsln.fsf@bauges.imag.fr>
Hi,
On Thu, 26 Jun 2008, Matthieu Moy wrote:
> Theodore Tso <tytso@mit.edu> writes:
>
> > for i in $*
>
> Detail: you meant "$@", your version isn't whitespace-robust.
In that case, you'd have to quote the variables in "$prefix$i" and "> $i",
too.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to
From: Johannes Schindelin @ 2008-06-26 12:07 UTC (permalink / raw)
To: Björn Steinbrink
Cc: Junio C Hamano, Theodore Tso, Johannes Sixt, Boaz Harrosh,
Steven Walter, git, jeske
In-Reply-To: <20080626115550.GA23058@atjola.homenet>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1093 bytes --]
Hi,
On Thu, 26 Jun 2008, Björn Steinbrink wrote:
> On 2008.06.25 10:22:08 -0700, Junio C Hamano wrote:
> > Theodore Tso <tytso@mit.edu> writes:
> >
> > > I used to argue for this, but gave up, because no one seemed to agree
> > > with me. So now I just have the following in
> > > /home/tytso/bin/git-revert-file and I am very happy:
> > >
> > > #!/bin/sh
> > > #
> > > prefix=$(git rev-parse --show-prefix)
> > >
> > > for i in $*
> > > do
> > > git show HEAD:$prefix$i > $i
> > > done
> >
> > Isn't that this?
> >
> > #!/bin/sh
> > exec git checkout HEAD -- "$@"
>
> I thought so at first, too, but there's one difference. Ted's version
> doesn't affect the index, while yours does. Of course I cannot tell if
> Ted actually intended not to touch the index ;-)
While we are nit-picking: Ted's version does not respect autocrlf, while
Junio's does.
Oh, and Junio's version works with spaces and other funny stuff in file
names, while Ted's does not.
Oh, and error checking is correct in Junio's version.
I am sure there are more differences.
Ciao,
Dscho
^ permalink raw reply
* Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to
From: Matthieu Moy @ 2008-06-26 12:01 UTC (permalink / raw)
To: Theodore Tso; +Cc: git
In-Reply-To: <20080625135100.GF20361@mit.edu>
Theodore Tso <tytso@mit.edu> writes:
> for i in $*
Detail: you meant "$@", your version isn't whitespace-robust.
--
Matthieu
^ permalink raw reply
* [TEASER PATCH] write .gitmodules according to core.autocrlf
From: Johannes Schindelin @ 2008-06-26 11:58 UTC (permalink / raw)
To: Edward Z. Yang; +Cc: git
In-Reply-To: <g3vaaq$pm1$1@ger.gmane.org>
This patch introduces the option "--crlf=<bool>" to git-config, which
tells git-config to write with or without CR/LF line endings. (Empty
means 'false'.)
This option is then used by git-submodule to write .gitmodules with
the correct line-endings according to core.autocrlf.
NOTE: this patch is _not_ meant for inclusion, but as a starting point.
I have _no_ desire to continue working on this topic. It is just a
proof of concept, and it is _your_ responsibility to get it into
submittable form.
This would involve:
- giving the option a better name (--crlf does not imply that
it is only for writing),
- move the declaration of the config_endl variable to somewhere
more public, such as cache.h,
- possibly even move the definition of config_endl to
environment.c,
- split the patch into the config-related and the
submodule-related part,
- add documentation both for the config-related as well as for
the submodule-related part,
- add tests,
- submit it, and be quick to fix whatever is criticized on the
Git mailing list.
If you do that, would be nice to give me some credit, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
builtin-config.c | 5 +++++
config.c | 14 +++++++++-----
git-submodule.sh | 15 ++++++++++-----
3 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/builtin-config.c b/builtin-config.c
index 3a441ef..6ab191f 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -17,6 +17,7 @@ static char delim = '=';
static char key_delim = ' ';
static char term = '\n';
static enum { T_RAW, T_INT, T_BOOL, T_BOOL_OR_INT } type = T_RAW;
+extern const char *config_endl;
static int show_all_config(const char *key_, const char *value_, void *cb)
{
@@ -334,6 +335,10 @@ int cmd_config(int argc, const char **argv, const char *prefix)
delim = '\n';
key_delim = '\n';
}
+ else if (!prefixcmp(argv[1], "--crlf="))
+ config_endl = argv[1][7] &&
+ git_config_bool("crlf", argv[1] + 7) ?
+ "\r\n" : "\n";
else if (!strcmp(argv[1], "--rename-section")) {
int ret;
if (argc != 4)
diff --git a/config.c b/config.c
index 58749bf..da9213e 100644
--- a/config.c
+++ b/config.c
@@ -15,6 +15,7 @@ static const char *config_file_name;
static int config_linenr;
static int config_file_eof;
static int zlib_compression_seen;
+const char *config_endl = "\n";
static int get_next_char(void)
{
@@ -749,9 +750,10 @@ static int store_write_section(int fd, const char* key)
strbuf_addch(&sb, '\\');
strbuf_addch(&sb, key[i]);
}
- strbuf_addstr(&sb, "\"]\n");
+ strbuf_addstr(&sb, "\"]");
+ strbuf_addstr(&sb, config_endl);
} else {
- strbuf_addf(&sb, "[%.*s]\n", store.baselen, key);
+ strbuf_addf(&sb, "[%.*s]%s", store.baselen, key, config_endl);
}
success = write_in_full(fd, sb.buf, sb.len) == sb.len;
@@ -789,7 +791,7 @@ static int store_write_pair(int fd, const char* key, const char* value)
for (i = 0; value[i]; i++)
switch (value[i]) {
case '\n':
- strbuf_addstr(&sb, "\\n");
+ strbuf_addstr(&sb, config_endl);
break;
case '\t':
strbuf_addstr(&sb, "\\t");
@@ -801,7 +803,7 @@ static int store_write_pair(int fd, const char* key, const char* value)
strbuf_addch(&sb, value[i]);
break;
}
- strbuf_addf(&sb, "%s\n", quote);
+ strbuf_addf(&sb, "%s%s", quote, config_endl);
success = write_in_full(fd, sb.buf, sb.len) == sb.len;
strbuf_release(&sb);
@@ -1047,7 +1049,9 @@ int git_config_set_multivar(const char* key, const char* value,
copy_end - copy_begin)
goto write_err_out;
if (new_line &&
- write_in_full(fd, "\n", 1) != 1)
+ write_in_full(fd, config_endl,
+ strlen(config_endl)) !=
+ strlen(config_endl))
goto write_err_out;
}
copy_begin = store.offset[i];
diff --git a/git-submodule.sh b/git-submodule.sh
index 3eb78cc..c551c74 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -27,6 +27,11 @@ say()
fi
}
+gitmodules_config ()
+{
+ git config -f .gitmodules --crlf=$(git config --bool core.autocrlf) "$@"
+}
+
# NEEDSWORK: identical function exists in get_repo_base in clone.sh
get_repo_base() {
(
@@ -74,8 +79,8 @@ module_name()
{
# Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
re=$(printf '%s\n' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
- name=$( git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
- sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
+ name=$(gitmodules_config '^submodule\..*\.path$' |
+ sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p')
test -z "$name" &&
die "No submodule mapping found in .gitmodules for path '$path'"
echo "$name"
@@ -198,8 +203,8 @@ cmd_add()
git add "$path" ||
die "Failed to add submodule '$path'"
- git config -f .gitmodules submodule."$path".path "$path" &&
- git config -f .gitmodules submodule."$path".url "$repo" &&
+ gitmodules_config submodule."$path".path "$path" &&
+ gitmodules_config submodule."$path".url "$repo" &&
git add .gitmodules ||
die "Failed to register submodule '$path'"
}
@@ -240,7 +245,7 @@ cmd_init()
url=$(git config submodule."$name".url)
test -z "$url" || continue
- url=$(git config -f .gitmodules submodule."$name".url)
+ url=$(gitmodules_config submodule."$name".url)
test -z "$url" &&
die "No url found for submodule path '$path' in .gitmodules"
--
1.5.6.173.gde14c
^ permalink raw reply related
* Re: [PATCH] cmd_reset: don't trash uncommitted changes unless told to
From: Björn Steinbrink @ 2008-06-26 11:55 UTC (permalink / raw)
To: Junio C Hamano
Cc: Theodore Tso, Johannes Schindelin, Johannes Sixt, Boaz Harrosh,
Steven Walter, git, jeske
In-Reply-To: <7v63rx2zwf.fsf@gitster.siamese.dyndns.org>
On 2008.06.25 10:22:08 -0700, Junio C Hamano wrote:
> Theodore Tso <tytso@mit.edu> writes:
>
> > I used to argue for this, but gave up, because no one seemed to agree
> > with me. So now I just have the following in
> > /home/tytso/bin/git-revert-file and I am very happy:
> >
> > #!/bin/sh
> > #
> > prefix=$(git rev-parse --show-prefix)
> >
> > for i in $*
> > do
> > git show HEAD:$prefix$i > $i
> > done
>
> Isn't that this?
>
> #!/bin/sh
> exec git checkout HEAD -- "$@"
I thought so at first, too, but there's one difference. Ted's version
doesn't affect the index, while yours does. Of course I cannot tell if
Ted actually intended not to touch the index ;-)
Björn
^ permalink raw reply
* Re: [OFF TOPIC] any views about the D programming language
From: Ittay Dror @ 2008-06-26 11:43 UTC (permalink / raw)
To: git
In-Reply-To: <alpine.DEB.1.00.0806261210120.9925@racer>
Johannes Schindelin wrote:
> Hi,
>
> On Thu, 26 Jun 2008, Ittay Dror wrote:
>
>
>> I've read the language war thread (C vs C++) and I'm wondering if
>> someone would like to share their views about using D instead of C.
>>
>
> I would like to ;-)
>
> This is open source. You are free to do what you want to do. You are
> even welcome to do so.
>
> Just do not expect many people to be able to comment on your work, let
> alone be enthusiastic to use it, if you use an obscure language.
>
> Just take Tcl as an example: it is not exactly obscure, has been around
> for ages, and many commercial programs actually use it as a scripting
> language.
>
> Yet, there are preciously few people who _ever_ contributed anything to
> gitk or git-gui, and you hear that the main reason is the language.
>
> OTOH C is a common denominator, educates its users to exercise lots of
> circumspection (which means that those users will invariably write less
> buggy code, even using other languages), and the code in Git is already
> written in it. So why not stop bitching and just continue using it?
>
>
Sorry, I wasn't bitching. In fact, I agree with most views about C vs
C++ (especially Linus' post). I just wanted to see if people think, in
general (not related to git) that D is better/worse than C. So if I were
to start a new project, would they recommend using D. That's it.
> Ciao,
> Dscho
>
>
--
--
Ittay Dror <ittay.dror@gmail.com>
^ permalink raw reply
* Re: policy and mechanism for less-connected clients
From: Theodore Tso @ 2008-06-26 11:37 UTC (permalink / raw)
To: David Jeske; +Cc: Junio C Hamano, git
On Thu, Jun 26, 2008 at 06:08:55AM -0000, David Jeske wrote:
> I can be better than cvs with the EXACT same workflow, by checking in their
> local changes (git checkin;) and then doing the "up" (git pull;). If they
> decide they botched their merge, they can get back to where they were before
> the UP because I'm using a richer underlying mechanism to implement their
> workflow.
This is a really good example of the problems involved. One of the
major problems with CVS is that CVS developers have a tendency to use
"cvs up" *way* too often --- i.e., with a dirty tree. Why do they
have a dirty tree? Well, generally because they commit too rarely;
since CVS branches are so awful to use, they generally don't use CVS
branches, and so if they are in the middle of making major changes the
source base, they may not do a CVS checkin for weeks or months, since
they don't want to break the centrally visible branch until their
project actuall is at a stage where it can be checked into the tree
without breaking core functionality.
(I once supervised a programmer who didn't do a CVS checkin for two
months, and then lost two months of work when his local disk died, and
as a result he had a nervous breakdown; you just can't make up some of
the massive, major problems that can result from CVS-inspired
workflows.)
So if you are going to accomodate the broken workflow where people
leave dirty state in their local tree for vast amounts of time, and
thus insist on running "cvs up" all the time, and will try to cover
for it by committing their work under their noses when they do the
equivalent of "cvs up" in a dirty worktree --- what does that mean?
Well, maybe you can make it work, but it breaks other nice features of
git. For example, it means that "git bisect" can't possibly work,
since there will be huge number of commits where the tree may not even
build!
Accomodating the CVS workflow is basically about the fact that users
don't want to learn about CVS branches, because they were horrible to
use, and even worse to merge. But that's not true with git branches;
so maybe it's better to teach them how to use git branches instead,
instead of trying to coddle them into letting them use the the same
old broken CVS workflow that was based on branch-avoidance?
I've created and taught a Usenix tutorial which covers the basics of
distributed source code management systems, including branches,
repositories, pushing and pulling between them, for git, hg, AND bzr,
and I did it in half a day. The concepts really aren't hard. The
main problem with git is that because the UI grew organically, there
are all sorts of exceptions and non-linearities in its CLI.
For example, the fact that "git checkout" can be used both to switch
between branches, and revert and editing file. Or the fact that how
you specify a set of revisions in git-format-patch is different in
terms of what happens when you specify a single commit; it's
documented in the man page now, at least, and people who teach git
after a while learn about the things that you have to teach newbies
that git experts take for granted. (Just as people who teach English
as a second language learn about all of the exceptions to the language
that you have to point out that are second nature to the natives.)
But really, git *isn't* that hard, once you get past the somewhat
awkard CLI. (It's no worse, and probably much better, than the Unix
shell/test/awk/sed/head/tail/sort/uniq/comm, etc. You just have to
get over the learning curve.)
> git's mechanisms are really great for making a hybrid
> central/distributed system which has the simplicity of cvs/perforce
> and several of the benefits of git. The git interface is just too
> complicated to be used for this. Fortunately, building on git means
> that power users will still be able to use git directly and people
> can distribute the repositories as much as they want.
I'd suggest that you try using git straight for a bit longer, before
you start drawing these conclusions. Trust me, the concepts of git
really aren't that hard to explain to people; that's not what you need
to hide from people coming from the CVS world. The hard part is the
fact that git's UI has all sorts of non-linearities and that git's
documentation and introductory tutorials are not as good as it should
be. (Although it's gotten a LOT better than just a year or two ago.)
Also, if your program when used by CVS refugees to causes the git
repository to be peppered with trash commits which don't build, even
if power users are using git directly, their ability to browse the
repository using "git log" or "gitk", or to try to find problems using
"git bisect", will be horribly, negatively affected. So I am a bit
worried that the result will end up destroying value for the project
in the long-term, and that the costs will not be matched by the
benefits of simply teaching the CVS refugees a few bits of git and
DSCM core concepts, which I've found is *not* the hard parts of
getting newbies to use git.
> Good question. I'm working on a command-line wrapper for git that does it.
> Digging into the "plumbling" is making it more obvious why I find git's
> porcelain operations hard to understand.
Exactly. So what I would ask you to consider is that you may find it
personally useful to design this system, but afterwards, before you
inflict it on projects, and deal with some of the attendent side
effects (like all of these trash commits causing "git bisect" to go
down the drain), that you consider whether *now* that you understand
how git works and why it does some of the things it does, and what the
shortcomings of the git porcelain are from a UI perspective, whether
CVS refugees really would be best served by this system you are
designing, or whether a few wrapper scripts to hide some of the more
pointy spikes in git's CLI, plus some better tutorials, might in the
long run be much better for these CVS developers that you are trying
to serve.
- Ted
^ permalink raw reply
* Re: git-diff/git-format-patch safe for GNU (or POSIX) patch?
From: Flavio Poletti @ 2008-06-26 11:49 UTC (permalink / raw)
To: git
In-Reply-To: <20080626103607.GA16525@diana.vm.bytemark.co.uk>
Thanks for the feedback! I wonder if this feature of patch "ignoring"
stuff it doesn't understand is a GNU feature or a POSIX feature, but I'm
abusing your patience here. (Incidentally, I also saw that POSIX has no
"unified" format, but this "ignoring" feature might apply in a wider
sense).
>> 4. some hints to use git for working on projects that do not use any
>> other VCS, or for which one only wants to produce and send a quick
>> patch starting from a tarball.
>
> You can use git/contrib/fast-import/import-tars.perl to import the
> last few releases into git (possibly just the last release, if you
> don't need the history) and then just build on that, and send patches
> back to the project when you're done.
>
> When the project makes another release, use import-tars to import the
> new tarball, and then rebase if you have any patches they haven't
> accepted yet.
Importing wasn't actually an issue, just a matter of init/add/commit. I
was more scared about the patch production process, i.e. producing a patch
that could be perfectly usable by the project's maintainers. But given
what you kindly said, I think I can dismiss this as excess of caution by
me.
Thanks,
Flavio.
^ permalink raw reply
* Re: git rebase interactive: usability issue
From: Dmitry Potapov @ 2008-06-26 11:35 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
In-Reply-To: <7vbq1ovpl7.fsf@gitster.siamese.dyndns.org>
Hi Junio,
Please, do not apply my previous patch. I just realized that it will
break the following sequence of commands when you are stopped on a
conflicting commit during rebase:
$ edit file
$ git add file
$ git commit
$ git commit --amend
I don't see a good solution right now. Perhaps, the better approach
will be to remove the suggestion of using "git commit --amend" and
instead to recommend to use "git add" to add your changes and then
run "git rebase --continue". This works regardless whether you stop
on the "edit" mark or conflict. The only problem with that is what
if the user actually wanted to edit the commit message. Currently,
saying just "git rebase --continue" without adding anything will
not allow you to edit the commit message.
After studying git-rebase script, I noticed that it always commit
with the --no-verify option. It makes sense for those commits that
were just "pick" but IMHO those commits that were edited by users
probably should be commited in the normal way, so the pre-commit
hook can ensure that your changes are okay.
Dmitry
^ permalink raw reply
* Re: how do I merge completely unrelated repositories ?
From: Johannes Schindelin @ 2008-06-26 11:25 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Christian MICHON, Git Mailing List
In-Reply-To: <20080626094522.GA29404@genesis.frugalware.org>
Hi,
On Thu, 26 Jun 2008, Miklos Vajna wrote:
> On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:
> > How would you do it, since merge will not merge if it cannot find a
> > common ancestor ?
>
> Did you try so?
>
> If there are no conflicting paths then a simple
>
> git pull /path/to/other/repo.git master
>
> or similar should work.
FWIW this is how gitk got into git.git... See 5569bf9b(Do a cross-project
merge of Paul Mackerras' gitk visualizer). This also was often referred
to as the "coolest merge ever".
Ciao,
Dscho
^ permalink raw reply
* Re: update-index --assume-unchanged doesn't make things go fast
From: Stephen R. van den Berg @ 2008-06-26 11:22 UTC (permalink / raw)
To: Avery Pennarun; +Cc: Git Mailing List
In-Reply-To: <32541b130806250944x717cf609x7aa520c77a7c6911@mail.gmail.com>
Avery Pennarun wrote:
>1) What's a sensible way to tell git to *not* opendir() specific
>directories to look for unexpected files in "git status"? (I don't
>think I know enough to implement this myself.)
Would checking the mtime on the directory itself help?
--
Sincerely,
Stephen R. van den Berg.
If mind over matter is a matter of course, does it matter if nobody minds?
^ permalink raw reply
* Re: [OFF TOPIC] any views about the D programming language
From: Johannes Schindelin @ 2008-06-26 11:15 UTC (permalink / raw)
To: Ittay Dror; +Cc: git
In-Reply-To: <48635047.30707@gmail.com>
Hi,
On Thu, 26 Jun 2008, Ittay Dror wrote:
> I've read the language war thread (C vs C++) and I'm wondering if
> someone would like to share their views about using D instead of C.
I would like to ;-)
This is open source. You are free to do what you want to do. You are
even welcome to do so.
Just do not expect many people to be able to comment on your work, let
alone be enthusiastic to use it, if you use an obscure language.
Just take Tcl as an example: it is not exactly obscure, has been around
for ages, and many commercial programs actually use it as a scripting
language.
Yet, there are preciously few people who _ever_ contributed anything to
gitk or git-gui, and you hear that the main reason is the language.
OTOH C is a common denominator, educates its users to exercise lots of
circumspection (which means that those users will invariably write less
buggy code, even using other languages), and the code in Git is already
written in it. So why not stop bitching and just continue using it?
Ciao,
Dscho
^ permalink raw reply
* Re: [q] git-diff --reverse 7def2be1..7def2be1^
From: Ingo Molnar @ 2008-06-26 11:08 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Matthieu Moy, git
In-Reply-To: <200806261302.03952.jnareb@gmail.com>
* Jakub Narebski <jnareb@gmail.com> wrote:
> On Thu, 26. Jun 2008, Ingo Molnar wrote:
> > * Jakub Narebski <jnareb@gmail.com> wrote:
> >> Ingo Molnar <mingo@elte.hu> writes:
> >>> * Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> >>>
> >>>> (BTW, git-foo is being obsoleted in favor of "git foo")
> >>>
> >>> hm, can Bash be taught to do command completion on 'git rer<tab>', like
> >>> it is able to do on git-rer<tab> ?
> >>
> >> contrib/completion/git-completion.bash in git repository.
> >
> > btw., i had to turn this off - it made certain types of file completions
> > almost unusable, by adding a 2-3 seconds delay (during which bash would
> > just spin around burning CPU time calculating its completion guesses).
>
> Perhaps it would be better when "ceiling dir" feature in git, and
> configured, so git don't waste time searching for git repositories
> where there aren't any.
>
> > and that was on a 3 GHz dual-core box ...
>
> I think this might depend more on filesystem used, and file hierarchy.
> And also probably on the number of branches...
well i wanted to say it's a box fast enough.
ext3, kernel tree, -tip repository with 142 local branches and 277 total
branches.
Ingo
^ permalink raw reply
* Re: how do I merge completely unrelated repositories ?
From: Jakub Narebski @ 2008-06-26 11:04 UTC (permalink / raw)
To: git
In-Reply-To: <46d6db660806260239xc57ffaag6469967ae2257cb1@mail.gmail.com>
Christian MICHON wrote:
> I'd like to create a new empty repository and merge into it 2
> completely unrelated remote repositories.
>
> How would you do it, since merge will not merge if it cannot find a
> common ancestor ?
The problem probably is _empty_ repository (what do you want to merge),
not lack of common ancestors. git.git repository has joined unrelated
projects (git-mail-tools, gitweb, gitk, git-gui) and it has several
roots, and even a few separate branches.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: [q] git-diff --reverse 7def2be1..7def2be1^
From: Jakub Narebski @ 2008-06-26 11:02 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Matthieu Moy, git
In-Reply-To: <20080626093726.GA24577@elte.hu>
On Thu, 26. Jun 2008, Ingo Molnar wrote:
> * Jakub Narebski <jnareb@gmail.com> wrote:
>> Ingo Molnar <mingo@elte.hu> writes:
>>> * Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
>>>
>>>> (BTW, git-foo is being obsoleted in favor of "git foo")
>>>
>>> hm, can Bash be taught to do command completion on 'git rer<tab>', like
>>> it is able to do on git-rer<tab> ?
>>
>> contrib/completion/git-completion.bash in git repository.
>
> btw., i had to turn this off - it made certain types of file completions
> almost unusable, by adding a 2-3 seconds delay (during which bash would
> just spin around burning CPU time calculating its completion guesses).
Perhaps it would be better when "ceiling dir" feature in git, and
configured, so git don't waste time searching for git repositories
where there aren't any.
> and that was on a 3 GHz dual-core box ...
I think this might depend more on filesystem used, and file hierarchy.
And also probably on the number of branches...
That said, I'm not fully happy with git bash completion[*1*] either:
one of complaints is that when completing "filename." on filename with
extension (for example to "filename.h") it sometimes treats "filename."
as beiginning of "<rev1>..<rev2>", and completes to "filename..",
even if there no 'filename' ref in repository.
> so please do not remove the git-* commands, they are really useful.
Well, they are not removed, just moved aside (to address complaints
of cluttering $PATH with 130+ programs), and I think that you can
always install everything into /usr/bin/, as usual. Although it would
be nice to be able to move aside only internal (*--*) commands, or
perhaps even internal and plumbing.
Footnotes:
==========
[*1*] I wonder how zsh git completion fares in comparison.
--
Jakub Narebski
Poland
^ permalink raw reply
* Re: how do I merge completely unrelated repositories ?
From: Christian MICHON @ 2008-06-26 10:51 UTC (permalink / raw)
To: Miklos Vajna; +Cc: Git Mailing List
In-Reply-To: <20080626094522.GA29404@genesis.frugalware.org>
On Thu, Jun 26, 2008 at 11:45 AM, Miklos Vajna <vmiklos@frugalware.org> wrote:
> On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:
>> How would you do it, since merge will not merge if it cannot find a
>> common ancestor ?
>
> Did you try so?
yes I did. it was failing.
>
> If there are no conflicting paths then a simple
>
> git pull /path/to/other/repo.git master
pull = fetch + merge
maybe I was not fetching the objects properly.
>
> or similar should work.
>
your hint works fine. thanks!
I was starting considering rebasing the 2 repos on a common empty
commit (that would have been desperate)...
--
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* Re: git-diff/git-format-patch safe for GNU (or POSIX) patch?
From: Karl Hasselström @ 2008-06-26 10:36 UTC (permalink / raw)
To: Flavio Poletti; +Cc: git
In-Reply-To: <58230.213.203.159.164.1214476059.squirrel@upmail.polettix.it>
On 2008-06-26 12:27:39 +0200, Flavio Poletti wrote:
> When I was happy with the modifications, I used git-format-patch to
> produce the message and the patch to send. I then saw that the
> format is a little different with respect to what diff -u produces;
> in particular, I noticed that there was an added line between the
> "diff --git..." line and the one stating the "origin" file:
>
> diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
> *** this one *** index 61d11ed..7786f10 100644
> --- a/glib/gstrfuncs.c
> +++ b/glib/gstrfuncs.c
patch ignores any junk it doesn't understand, including this line.
> Moreover, each chunk's header contained added stuff, like the
> "g_ascii_strtoll..." stuff in the following example line:
>
> @@ -813,6 +813,8 @@ g_ascii_strtoll (const gchar *nptr,
You get this by giving the -p flag to GNU diff; git diff just does it
by default, is all.
> 4. some hints to use git for working on projects that do not use any
> other VCS, or for which one only wants to produce and send a quick
> patch starting from a tarball.
You can use git/contrib/fast-import/import-tars.perl to import the
last few releases into git (possibly just the last release, if you
don't need the history) and then just build on that, and send patches
back to the project when you're done.
When the project makes another release, use import-tars to import the
new tarball, and then rebase if you have any patches they haven't
accepted yet.
--
Karl Hasselström, kha@treskal.com
www.treskal.com/kalle
^ permalink raw reply
* Re: about c8af1de9 (git status uses pager)
From: Wincent Colaiuta @ 2008-06-26 10:17 UTC (permalink / raw)
To: Dan McGee; +Cc: git
In-Reply-To: <g3v3s1$bok$1@ger.gmane.org>
El 26/6/2008, a las 5:53, Dan McGee escribió:
> Why did this patch get pulled in with so little discussion? Didn't
> someone think that there must be a reason git-status didn't use a
> pager before?
I believe it was discussed in at least a couple of threads back then:
Original patch in late April, 3 messages:
http://article.gmane.org/gmane.comp.version-control.git/80279/
Follow-up discussion in early May, 31 messages:
http://article.gmane.org/gmane.comp.version-control.git/80957/
Wincent
^ permalink raw reply
* git-diff/git-format-patch safe for GNU (or POSIX) patch?
From: Flavio Poletti @ 2008-06-26 10:27 UTC (permalink / raw)
To: git
Hi,
I had to dig a problem in Glib ("base" library for GTK) in Debian Etch
recently and I decided to manage changes/diffs with git. It's just so
easy to use and avoids all the usual copy-the-tree-then-diff that I
used before.
When I was happy with the modifications, I used git-format-patch to
produce the message and the patch to send. I then saw that the format is a
little different with respect to what diff -u produces; in particular, I
noticed that there was an added line between the "diff --git..." line and
the one stating the "origin" file:
diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
*** this one *** index 61d11ed..7786f10 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
Moreover, each chunk's header contained added stuff, like the
"g_ascii_strtoll..." stuff in the following example line:
@@ -813,6 +813,8 @@ g_ascii_strtoll (const gchar *nptr,
Before sending the patch, I tried to "reverse" these "deviations" from the
normal diff output, but I was quite sure there was no need to do this. I
then tried to use GNU patch with the unaltered message, and it seemed
quite happy with all the extra stuff.
Just to be on the safe side, I tried to look for:
1. the "official" unified diff spec
2. a description of what patch is willing to consider valid input
3. some notes about how git-diff copes with patch compatibility
4. some hints to use git for working on projects that do not use any other
VCS, or for which one only wants to produce and send a quick patch
starting from a tarball.
I had no luck with the first two attempts, and a moderate luck with the
third: there is more than one email from Junio C. Hamano either stating
that git-diff strives to be nice with patch, or containing patches to
address possible conformance issues. I was also quite unluck with the
fourth attempt, even if this is surely due to my poor websurfing-fu.
Anyway, the messages from Mr. Hamano kind-of answer the question in the
subject, but in a somehow "implicit" way rather than explicitly. In
particular, I wonder if there is any document about how a "valid" unified
diff should look like (including optional valid extensions) that was used
as input and reference for git-diff development. Or had you just to figure
it out from diff/patch sources?
Thank you,
Flavio.
^ permalink raw reply
* Re: how do I merge completely unrelated repositories ?
From: Miklos Vajna @ 2008-06-26 9:45 UTC (permalink / raw)
To: Christian MICHON; +Cc: Git Mailing List
In-Reply-To: <46d6db660806260239xc57ffaag6469967ae2257cb1@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 317 bytes --]
On Thu, Jun 26, 2008 at 11:39:37AM +0200, Christian MICHON <christian.michon@gmail.com> wrote:
> How would you do it, since merge will not merge if it cannot find a
> common ancestor ?
Did you try so?
If there are no conflicting paths then a simple
git pull /path/to/other/repo.git master
or similar should work.
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* how do I merge completely unrelated repositories ?
From: Christian MICHON @ 2008-06-26 9:39 UTC (permalink / raw)
To: Git Mailing List
Hi,
I'd like to create a new empty repository and merge into it 2
completely unrelated remote repositories.
How would you do it, since merge will not merge if it cannot find a
common ancestor ?
--
Christian
--
http://detaolb.sourceforge.net/, a linux distribution for Qemu with Git inside !
^ permalink raw reply
* Re: [q] git-diff --reverse 7def2be1..7def2be1^
From: Ingo Molnar @ 2008-06-26 9:37 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Matthieu Moy, git
In-Reply-To: <m34p7ombie.fsf@localhost.localdomain>
* Jakub Narebski <jnareb@gmail.com> wrote:
> Ingo Molnar <mingo@elte.hu> writes:
>
> > * Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
> >
> > > (BTW, git-foo is being obsoleted in favor of "git foo")
> >
> > hm, can Bash be taught to do command completion on 'git rer<tab>', like
> > it is able to do on git-rer<tab> ?
>
> contrib/completion/git-completion.bash in git repository.
btw., i had to turn this off - it made certain types of file completions
almost unusable, by adding a 2-3 seconds delay (during which bash would
just spin around burning CPU time calculating its completion guesses).
and that was on a 3 GHz dual-core box ...
so please do not remove the git-* commands, they are really useful.
Ingo
^ permalink raw reply
* Re: [REPLACEMENT PATCH] parse-opt: fake short strings for callers to believe in.
From: Pierre Habouzit @ 2008-06-26 9:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v7iccsi6n.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]
On Thu, Jun 26, 2008 at 08:40:16AM +0000, Junio C Hamano wrote:
> Pierre Habouzit <madcoder@debian.org> writes:
>
> > I saw that you merged this series into pu, for which I'm really glad,
>
> Heh, you shouldn't be glad to have "landed" on 'pu', as being in 'pu' is
> just a sign of "undecided" ;-)
>
> And thanks for a reminder. Every bit of help to make integration smoother
> really helps.
You're welcome.
> I've been swamped and I still have your "revisions: refactor
> init_revisions and setup_revisions" sitting in my inbox.
Well I'll resubmit it probably in some kind of improved way that mixes
better within the parse-options stuff. Trust me for not forgetting about
it. IOW the refactor will remain, but it will probably become some kind
of series with a second refactor where parse_revisions has a
'eat-one-option-at-a-time' behavior as well.
Though I believe the current stuff I point you to, to be quite ready
(except for the builtin-blame proof of concept that is .. a PoC, not
really meant for next), and once it'll be ready for next, I'll try to
work on the options in git again, because it can be done in an
incremental way now :)
--
·O· Pierre Habouzit
··O madcoder@debian.org
OOO http://www.madism.org
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply
* Re: [PATCH] git.el: Don't reset HEAD in git-amend-file.
From: Alexandre Julliard @ 2008-06-26 8:25 UTC (permalink / raw)
To: Nikolaj Schumacher; +Cc: git
In-Reply-To: <m2myle77bb.fsf@nschum.de>
Nikolaj Schumacher <n_schumacher@web.de> writes:
> The current implementation of git-amend-file is a little dangerous.
> While git --amend is atomic, git-amend-file is not.
>
> If the user calls it, but doesn't go through with the commit (due to
> error or choice), git --reset HEAD^ has been called anyway.
That's a feature, even if it's a little dangerous. You have to reset
HEAD to be able to properly do diffs, refreshes, etc. Maybe there should
be an easier way to redo the commit if you change your mind, but the
command would be much less useful without the reset.
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply
* Re: Errors building git-1.5.6 from source on Mac OS X 10.4.11
From: Ifejinelo Onyiah @ 2008-06-26 8:48 UTC (permalink / raw)
To: Alex Riesen; +Cc: git
In-Reply-To: <20080625175311.GB4039@steel.home>
[-- Attachment #1: Type: text/plain, Size: 812 bytes --]
2008/6/25 Alex Riesen <raa.lkml@gmail.com>:
> Ifejinelo Onyiah, Wed, Jun 25, 2008 15:20:39 +0200:
>>
>> They all run fine but when I issue the make test command, it dies at
>> the following:
>>
>> % make test
>>
>> ... TRUNCATED OUTPUT ...
>>
>> *** t2004-checkout-cache-temp.sh ***
>> * FAIL 1: preparation
>>
>
> If you don't mind helping the investigation a bit, could you please go
> into the t/ directory and run
>
> bash -x t2004-checkout-cache-temp.sh -d -v -i
>
> and post the output here?
I ran that command and it seemed to run with no problems. I have
provided the output in 2 attached text files. I hope that is ok.
> This diagnostics are much more useful (well, essential, in this case). Are running the tests on HFS+, BTW?
>
I am not sure of that. This is my first time I've heard of HFS+.
[-- Attachment #2: stderr.txt --]
[-- Type: text/plain, Size: 53156 bytes --]
+ test_description=git checkout-index --temp test.
With --temp flag, git checkout-index writes to temporary merge files
rather than the tracked path.
+ . ./test-lib.sh
++ ORIGINAL_TERM=xterm-color
++ LANG=C
++ LC_ALL=C
++ PAGER=cat
++ TZ=UTC
++ TERM=dumb
++ export LANG LC_ALL PAGER TERM TZ
++ EDITOR=:
++ VISUAL=:
++ unset GIT_EDITOR
++ unset AUTHOR_DATE
++ unset AUTHOR_EMAIL
++ unset AUTHOR_NAME
++ unset COMMIT_AUTHOR_EMAIL
++ unset COMMIT_AUTHOR_NAME
++ unset EMAIL
++ unset GIT_ALTERNATE_OBJECT_DIRECTORIES
++ unset GIT_AUTHOR_DATE
++ GIT_AUTHOR_EMAIL=author@example.com
++ GIT_AUTHOR_NAME=A U Thor
++ unset GIT_COMMITTER_DATE
++ GIT_COMMITTER_EMAIL=committer@example.com
++ GIT_COMMITTER_NAME=C O Mitter
++ unset GIT_DIFF_OPTS
++ unset GIT_DIR
++ unset GIT_WORK_TREE
++ unset GIT_EXTERNAL_DIFF
++ unset GIT_INDEX_FILE
++ unset GIT_OBJECT_DIRECTORY
++ unset SHA1_FILE_DIRECTORIES
++ unset SHA1_FILE_DIRECTORY
++ GIT_MERGE_VERBOSITY=5
++ export GIT_MERGE_VERBOSITY
++ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
++ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
++ export EDITOR VISUAL
++ GIT_TEST_CMP=diff -u
++ unset CDPATH
+++ echo
+++ tr '[A-Z]' '[a-z]'
++ '[' xxterm-color '!=' xdumb ']'
++ TERM=xterm-color
++ export TERM
++ '[' -t 1 ']'
++ test 3 -ne 0
++ debug=t
++ shift
++ test 2 -ne 0
++ verbose=t
++ shift
++ test 1 -ne 0
++ immediate=t
++ shift
++ test 0 -ne 0
++ test -n ''
++ test 'git checkout-index --temp test.
With --temp flag, git checkout-index writes to temporary merge files
rather than the tracked path.' '!=' ''
++ test '' = t
++ exec
++ test t = t
++ exec
++ test_failure=0
++ test_count=0
++ test_fixed=0
++ test_broken=0
++ trap die exit
+++ pwd
++ PATH=/Users/io1/Desktop/git-1.5.6/t/..:/usr/local/bin:/usr/local/mysql/bin:/Users/io1/Applications/Ruby/bin:/Users/io1/Applications/Perl/bin:/bin:/sbin:/usr/bin:/usr/sbin
+++ pwd
++ GIT_EXEC_PATH=/Users/io1/Desktop/git-1.5.6/t/..
+++ pwd
++ GIT_TEMPLATE_DIR=/Users/io1/Desktop/git-1.5.6/t/../templates/blt
++ unset GIT_CONFIG
++ unset GIT_CONFIG_LOCAL
++ GIT_CONFIG_NOSYSTEM=1
++ GIT_CONFIG_NOGLOBAL=1
++ export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
+++ pwd
+++ pwd
++ GITPERLLIB=/Users/io1/Desktop/git-1.5.6/t/../perl/blib/lib:/Users/io1/Desktop/git-1.5.6/t/../perl/blib/arch/auto/Git
++ export GITPERLLIB
++ test -d ../templates/blt
++ test -x ../test-chmtime
++ . ../GIT-BUILD-OPTIONS
+++ SHELL_PATH=/bin/sh
++ test=trash directory
++ rm -fr 'trash directory'
++ test_create_repo 'trash directory'
++ test 1 = 1
+++ pwd
++ owd=/Users/io1/Desktop/git-1.5.6/t
++ repo=trash directory
++ mkdir 'trash directory'
++ cd 'trash directory'
++ /Users/io1/Desktop/git-1.5.6/t/../git init --template=/Users/io1/Desktop/git-1.5.6/t/../templates/blt/
++ mv .git/hooks .git/hooks-disabled
++ cd /Users/io1/Desktop/git-1.5.6/t
++ cd -P 'trash directory'
+++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
++ this_test=t2004
+ test_expect_success preparation '
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
+ test 2 = 2
+ test_skip preparation '
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 0 + 1
+ this_test=t2004.1
+ to_skip=
+ false
+ say 'expecting success:
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
+ say_color info 'expecting success:
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
+ test -z info
+ shift
+ echo '* expecting success:
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
+ test_run_ '
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
+ eval '
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)'
++ mkdir asubdir
++ echo tree1path0
++ echo tree1path1
++ echo tree1path3
++ echo tree1path4
++ echo tree1asubdir/path5
++ git update-index --add path0 path1 path3 path4 asubdir/path5
+++ git write-tree
++ t1=55e7ce41e13ffba28c4b9d7b40c5b338786c48b5
++ rm -f path0 path1 path3 path4 '.merge_*' out .git/index
++ echo tree2path0
++ echo tree2path1
++ echo tree2path2
++ echo tree2path4
++ git update-index --add path0 path1 path2 path4
+++ git write-tree
++ t2=9ad8b17bf35b3a2e8f34dc723dd036870eaf5ecf
++ rm -f path0 path1 path2 path4 '.merge_*' out .git/index
++ echo tree2path0
++ echo tree3path1
++ echo tree3path2
++ echo tree3path3
++ git update-index --add path0 path1 path2 path3
+++ git write-tree
++ t3=869c54176b16104872b38d0471bc4fcc35f46beb
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ preparation
++ expr 0 + 1
+ test_count=1
+ say_color '' ' ok 1: preparation'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 1: preparation'
+ echo ''
+ test_expect_success 'checkout one stage 0 to temporary file' '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
+ test 2 = 2
+ test_skip 'checkout one stage 0 to temporary file' '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 1 + 1
+ this_test=t2004.2
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
+ say_color info 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
+ test_run_ '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
+ eval '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1'
++ rm -f path0 path1 path2 path3 '.merge_*' out .git/index
++ git read-tree 55e7ce41e13ffba28c4b9d7b40c5b338786c48b5
++ git checkout-index --temp -- path1
+++ wc -l
++ test 1 = 1
+++ cut '-d ' -f2 out
++ test path1 = path1
+++ cut '-d ' -f1 out
++ p=.merge_file_SkWrTm
++ test -f .merge_file_SkWrTm
+++ cat .merge_file_SkWrTm
++ test tree1path1 = tree1path1
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout one stage 0 to temporary file'
++ expr 1 + 1
+ test_count=2
+ say_color '' ' ok 2: checkout one stage 0 to temporary file'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 2: checkout one stage 0 to temporary file'
+ echo ''
+ test_expect_success 'checkout all stage 0 to temporary files' '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
+ test 2 = 2
+ test_skip 'checkout all stage 0 to temporary files' '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 2 + 1
+ this_test=t2004.3
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
+ say_color info 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
+ test_run_ '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
+ eval '
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done'
++ rm -f 'path*' .merge_file_SkWrTm out .git/index
++ git read-tree 55e7ce41e13ffba28c4b9d7b40c5b338786c48b5
++ git checkout-index -a --temp
+++ wc -l
++ test 5 = 5
+++ cut '-d ' -f2
+++ grep path0 out
++ test path0 = path0
+++ grep path0 out
+++ cut '-d ' -f1
++ p=.merge_file_umMWZK
++ test -f .merge_file_umMWZK
+++ cat .merge_file_umMWZK
++ test tree1path0 = tree1path0
+++ grep path1 out
+++ cut '-d ' -f2
++ test path1 = path1
+++ cut '-d ' -f1
+++ grep path1 out
++ p=.merge_file_pqCP9Q
++ test -f .merge_file_pqCP9Q
+++ cat .merge_file_pqCP9Q
++ test tree1path1 = tree1path1
+++ grep path3 out
+++ cut '-d ' -f2
++ test path3 = path3
+++ grep path3 out
+++ cut '-d ' -f1
++ p=.merge_file_htNBuR
++ test -f .merge_file_htNBuR
+++ cat .merge_file_htNBuR
++ test tree1path3 = tree1path3
+++ cut '-d ' -f2
+++ grep path4 out
++ test path4 = path4
+++ grep path4 out
+++ cut '-d ' -f1
++ p=.merge_file_wK37Ga
++ test -f .merge_file_wK37Ga
+++ cat .merge_file_wK37Ga
++ test tree1path4 = tree1path4
+++ grep asubdir/path5 out
+++ cut '-d ' -f2
++ test asubdir/path5 = asubdir/path5
+++ grep asubdir/path5 out
+++ cut '-d ' -f1
++ p=.merge_file_HHTltB
++ test -f .merge_file_HHTltB
+++ cat .merge_file_HHTltB
++ test tree1asubdir/path5 = tree1asubdir/path5
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout all stage 0 to temporary files'
++ expr 2 + 1
+ test_count=3
+ say_color '' ' ok 3: checkout all stage 0 to temporary files'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 3: checkout all stage 0 to temporary files'
+ echo ''
+ test_expect_success 'prepare 3-way merge' '
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
+ test 2 = 2
+ test_skip 'prepare 3-way merge' '
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 3 + 1
+ this_test=t2004.4
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
+ say_color info 'expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
+ test_run_ '
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
+ eval '
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3'
++ rm -f 'path*' .merge_file_HHTltB .merge_file_htNBuR .merge_file_pqCP9Q .merge_file_umMWZK .merge_file_wK37Ga out .git/index
++ git read-tree -m 55e7ce41e13ffba28c4b9d7b40c5b338786c48b5 9ad8b17bf35b3a2e8f34dc723dd036870eaf5ecf 869c54176b16104872b38d0471bc4fcc35f46beb
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'prepare 3-way merge'
++ expr 3 + 1
+ test_count=4
+ say_color '' ' ok 4: prepare 3-way merge'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 4: prepare 3-way merge'
+ echo ''
+ test_expect_success 'checkout one stage 2 to temporary file' '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
+ test 2 = 2
+ test_skip 'checkout one stage 2 to temporary file' '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 4 + 1
+ this_test=t2004.5
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
+ eval '
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1'
++ rm -f 'path*' '.merge_*' out
++ git checkout-index --stage=2 --temp -- path1
+++ wc -l
++ test 1 = 1
+++ cut '-d ' -f2 out
++ test path1 = path1
+++ cut '-d ' -f1 out
++ p=.merge_file_Pq7U41
++ test -f .merge_file_Pq7U41
+++ cat .merge_file_Pq7U41
++ test tree2path1 = tree2path1
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout one stage 2 to temporary file'
++ expr 4 + 1
+ test_count=5
+ say_color '' ' ok 5: checkout one stage 2 to temporary file'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 5: checkout one stage 2 to temporary file'
+ echo ''
+ test_expect_success 'checkout all stage 2 to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
+ test 2 = 2
+ test_skip 'checkout all stage 2 to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 5 + 1
+ this_test=t2004.6
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
+ eval '
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done'
++ rm -f 'path*' .merge_file_Pq7U41 out
++ git checkout-index --all --stage=2 --temp
+++ wc -l
++ test 3 = 3
+++ grep path1 out
+++ cut '-d ' -f2
++ test path1 = path1
+++ grep path1 out
+++ cut '-d ' -f1
++ p=.merge_file_bE0Spf
++ test -f .merge_file_bE0Spf
+++ cat .merge_file_bE0Spf
++ test tree2path1 = tree2path1
+++ grep path2 out
+++ cut '-d ' -f2
++ test path2 = path2
+++ grep path2 out
+++ cut '-d ' -f1
++ p=.merge_file_tAZ3x2
++ test -f .merge_file_tAZ3x2
+++ cat .merge_file_tAZ3x2
++ test tree2path2 = tree2path2
+++ cut '-d ' -f2
+++ grep path4 out
++ test path4 = path4
+++ grep path4 out
+++ cut '-d ' -f1
++ p=.merge_file_5R9M2N
++ test -f .merge_file_5R9M2N
+++ cat .merge_file_5R9M2N
++ test tree2path4 = tree2path4
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout all stage 2 to temporary files'
++ expr 5 + 1
+ test_count=6
+ say_color '' ' ok 6: checkout all stage 2 to temporary files'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 6: checkout all stage 2 to temporary files'
+ echo ''
+ test_expect_success 'checkout all stages/one file to nothing' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
+ test 2 = 2
+ test_skip 'checkout all stages/one file to nothing' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 6 + 1
+ this_test=t2004.7
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
+ eval '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0'
++ rm -f 'path*' .merge_file_5R9M2N .merge_file_bE0Spf .merge_file_tAZ3x2 out
++ git checkout-index --stage=all --temp -- path0
git-checkout-index: path0 does not exist at stage 4
+++ wc -l
++ test 0 = 0
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout all stages/one file to nothing'
++ expr 6 + 1
+ test_count=7
+ say_color '' ' ok 7: checkout all stages/one file to nothing'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 7: checkout all stages/one file to nothing'
+ echo ''
+ test_expect_success 'checkout all stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test 2 = 2
+ test_skip 'checkout all stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 7 + 1
+ this_test=t2004.8
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ eval '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
++ rm -f 'path*' '.merge_*' out
++ git checkout-index --stage=all --temp -- path1
+++ wc -l
++ test 1 = 1
+++ cut '-d ' -f2 out
++ test path1 = path1
++ cut '-d ' -f1 out
++ read s1 s2 s3
++ test -f .merge_file_JSK1BD
++ test -f .merge_file_zH0Aoa
++ test -f .merge_file_8ToCkP
+++ cat .merge_file_JSK1BD
++ test tree1path1 = tree1path1
+++ cat .merge_file_zH0Aoa
++ test tree2path1 = tree2path1
+++ cat .merge_file_8ToCkP
++ test tree3path1 = tree3path1
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout all stages/one file to temporary files'
++ expr 7 + 1
+ test_count=8
+ say_color '' ' ok 8: checkout all stages/one file to temporary files'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 8: checkout all stages/one file to temporary files'
+ echo ''
+ test_expect_success 'checkout some stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test 2 = 2
+ test_skip 'checkout some stages/one file to temporary files' '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 8 + 1
+ this_test=t2004.9
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ eval '
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
++ rm -f 'path*' .merge_file_8ToCkP .merge_file_JSK1BD .merge_file_zH0Aoa out
++ git checkout-index --stage=all --temp -- path2
+++ wc -l
++ test 1 = 1
+++ cut '-d ' -f2 out
++ test path2 = path2
++ cut '-d ' -f1 out
++ read s1 s2 s3
++ test . = .
++ test -f .merge_file_0O9Rze
++ test -f .merge_file_4ya4xG
+++ cat .merge_file_0O9Rze
++ test tree2path2 = tree2path2
+++ cat .merge_file_4ya4xG
++ test tree3path2 = tree3path2
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout some stages/one file to temporary files'
++ expr 8 + 1
+ test_count=9
+ say_color '' ' ok 9: checkout some stages/one file to temporary files'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 9: checkout some stages/one file to temporary files'
+ echo ''
+ test_expect_success 'checkout all stages/all files to temporary files' '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
+ test 2 = 2
+ test_skip 'checkout all stages/all files to temporary files' '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 9 + 1
+ this_test=t2004.10
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
+ say_color info 'expecting success:
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
+ test_run_ '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
+ eval '
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5'
++ rm -f 'path*' .merge_file_0O9Rze .merge_file_4ya4xG out
++ git checkout-index -a --stage=all --temp
+++ wc -l
++ test 5 = 5
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout all stages/all files to temporary files'
++ expr 9 + 1
+ test_count=10
+ say_color '' ' ok 10: checkout all stages/all files to temporary files'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 10: checkout all stages/all files to temporary files'
+ echo ''
+ test_expect_success '-- path0: no entry' '
test x$(grep path0 out | cut "-d " -f2) = x'
+ test 2 = 2
+ test_skip '-- path0: no entry' '
test x$(grep path0 out | cut "-d " -f2) = x'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 10 + 1
+ this_test=t2004.11
+ to_skip=
+ false
+ say 'expecting success:
test x$(grep path0 out | cut "-d " -f2) = x'
+ say_color info 'expecting success:
test x$(grep path0 out | cut "-d " -f2) = x'
+ test -z info
+ shift
+ echo '* expecting success:
test x$(grep path0 out | cut "-d " -f2) = x'
+ test_run_ '
test x$(grep path0 out | cut "-d " -f2) = x'
+ eval '
test x$(grep path0 out | cut "-d " -f2) = x'
+++ grep path0 out
+++ cut '-d ' -f2
++ test x = x
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- path0: no entry'
++ expr 10 + 1
+ test_count=11
+ say_color '' ' ok 11: -- path0: no entry'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 11: -- path0: no entry'
+ echo ''
+ test_expect_success '-- path1: all 3 stages' '
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test 2 = 2
+ test_skip '-- path1: all 3 stages' '
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 11 + 1
+ this_test=t2004.12
+ to_skip=
+ false
+ say 'expecting success:
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ say_color info 'expecting success:
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test -z info
+ shift
+ echo '* expecting success:
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ test_run_ '
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+ eval '
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)'
+++ grep path1 out
+++ cut '-d ' -f2
++ test path1 = path1
++ grep path1 out
++ cut '-d ' -f1
++ read s1 s2 s3
++ test -f .merge_file_h8tXrD
++ test -f .merge_file_rN8rTd
++ test -f .merge_file_dmW8IZ
+++ cat .merge_file_h8tXrD
++ test tree1path1 = tree1path1
+++ cat .merge_file_rN8rTd
++ test tree2path1 = tree2path1
+++ cat .merge_file_dmW8IZ
++ test tree3path1 = tree3path1
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- path1: all 3 stages'
++ expr 11 + 1
+ test_count=12
+ say_color '' ' ok 12: -- path1: all 3 stages'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 12: -- path1: all 3 stages'
+ echo ''
+ test_expect_success '-- path2: no stage 1, have stage 2 and 3' '
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test 2 = 2
+ test_skip '-- path2: no stage 1, have stage 2 and 3' '
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 12 + 1
+ this_test=t2004.13
+ to_skip=
+ false
+ say 'expecting success:
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ say_color info 'expecting success:
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test -z info
+ shift
+ echo '* expecting success:
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ test_run_ '
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+ eval '
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)'
+++ grep path2 out
+++ cut '-d ' -f2
++ test path2 = path2
++ grep path2 out
++ cut '-d ' -f1
++ read s1 s2 s3
++ test . = .
++ test -f .merge_file_jmbxjv
++ test -f .merge_file_8cWHrQ
+++ cat .merge_file_jmbxjv
++ test tree2path2 = tree2path2
+++ cat .merge_file_8cWHrQ
++ test tree3path2 = tree3path2
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- path2: no stage 1, have stage 2 and 3'
++ expr 12 + 1
+ test_count=13
+ say_color '' ' ok 13: -- path2: no stage 1, have stage 2 and 3'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 13: -- path2: no stage 1, have stage 2 and 3'
+ echo ''
+ test_expect_success '-- path3: no stage 2, have stage 1 and 3' '
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+ test 2 = 2
+ test_skip '-- path3: no stage 2, have stage 1 and 3' '
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 13 + 1
+ this_test=t2004.14
+ to_skip=
+ false
+ say 'expecting success:
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+ say_color info 'expecting success:
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+ test -z info
+ shift
+ echo '* expecting success:
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+ test_run_ '
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+ eval '
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)'
+++ grep path3 out
+++ cut '-d ' -f2
++ test path3 = path3
++ grep path3 out
++ cut '-d ' -f1
++ read s1 s2 s3
++ test -f .merge_file_6iyvpx
++ test . = .
++ test -f .merge_file_bFIigi
+++ cat .merge_file_6iyvpx
++ test tree1path3 = tree1path3
+++ cat .merge_file_bFIigi
++ test tree3path3 = tree3path3
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- path3: no stage 2, have stage 1 and 3'
++ expr 13 + 1
+ test_count=14
+ say_color '' ' ok 14: -- path3: no stage 2, have stage 1 and 3'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 14: -- path3: no stage 2, have stage 1 and 3'
+ echo ''
+ test_expect_success '-- path4: no stage 3, have stage 1 and 3' '
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+ test 2 = 2
+ test_skip '-- path4: no stage 3, have stage 1 and 3' '
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 14 + 1
+ this_test=t2004.15
+ to_skip=
+ false
+ say 'expecting success:
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+ say_color info 'expecting success:
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+ test -z info
+ shift
+ echo '* expecting success:
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+ test_run_ '
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+ eval '
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)'
+++ grep path4 out
+++ cut '-d ' -f2
++ test path4 = path4
++ grep path4 out
++ cut '-d ' -f1
++ read s1 s2 s3
++ test -f .merge_file_f0hTvT
++ test -f .merge_file_sYiYst
++ test . = .
+++ cat .merge_file_f0hTvT
++ test tree1path4 = tree1path4
+++ cat .merge_file_sYiYst
++ test tree2path4 = tree2path4
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- path4: no stage 3, have stage 1 and 3'
++ expr 14 + 1
+ test_count=15
+ say_color '' ' ok 15: -- path4: no stage 3, have stage 1 and 3'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 15: -- path4: no stage 3, have stage 1 and 3'
+ echo ''
+ test_expect_success '-- asubdir/path5: no stage 2 and 3 have stage 1' '
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+ test 2 = 2
+ test_skip '-- asubdir/path5: no stage 2 and 3 have stage 1' '
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 15 + 1
+ this_test=t2004.16
+ to_skip=
+ false
+ say 'expecting success:
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+ say_color info 'expecting success:
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+ test -z info
+ shift
+ echo '* expecting success:
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+ test_run_ '
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+ eval '
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)'
+++ grep asubdir/path5 out
+++ cut '-d ' -f2
++ test asubdir/path5 = asubdir/path5
++ grep asubdir/path5 out
++ cut '-d ' -f1
++ read s1 s2 s3
++ test -f .merge_file_lcEv2j
++ test . = .
++ test . = .
+++ cat .merge_file_lcEv2j
++ test tree1asubdir/path5 = tree1asubdir/path5
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ '-- asubdir/path5: no stage 2 and 3 have stage 1'
++ expr 15 + 1
+ test_count=16
+ say_color '' ' ok 16: -- asubdir/path5: no stage 2 and 3 have stage 1'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 16: -- asubdir/path5: no stage 2 and 3 have stage 1'
+ echo ''
+ test_expect_success 'checkout --temp within subdir' '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
+ test 2 = 2
+ test_skip 'checkout --temp within subdir' '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 16 + 1
+ this_test=t2004.17
+ to_skip=
+ false
+ say 'expecting success:
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
+ say_color info 'expecting success:
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
+ test -z info
+ shift
+ echo '* expecting success:
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
+ test_run_ '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
+ eval '
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)'
++ cd asubdir
++ git checkout-index -a --stage=all
+++ wc -l
++ test 1 = 1
+++ grep path5 out
+++ cut '-d ' -f2
++ test path5 = path5
++ grep path5 out
++ read s1 s2 s3
++ cut '-d ' -f1
++ test -f ../.merge_file_PGoCjL
++ test . = .
++ test . = .
+++ cat ../.merge_file_PGoCjL
++ test tree1asubdir/path5 = tree1asubdir/path5
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout --temp within subdir'
++ expr 16 + 1
+ test_count=17
+ say_color '' ' ok 17: checkout --temp within subdir'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 17: checkout --temp within subdir'
+ echo ''
+ test_expect_success 'checkout --temp symlink' '
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
+ test 2 = 2
+ test_skip 'checkout --temp symlink' '
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
++ expr ./t2004-checkout-cache-temp.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t2004
++ expr 17 + 1
+ this_test=t2004.18
+ to_skip=
+ false
+ say 'expecting success:
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
+ say_color info 'expecting success:
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
+ test -z info
+ shift
+ echo '* expecting success:
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
+ test_run_ '
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
+ eval '
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b'
++ rm -f 'path*' .merge_file_6iyvpx .merge_file_8cWHrQ .merge_file_PGoCjL .merge_file_bFIigi .merge_file_dmW8IZ .merge_file_f0hTvT .merge_file_h8tXrD .merge_file_jmbxjv .merge_file_lcEv2j .merge_file_rN8rTd .merge_file_sYiYst out .git/index
++ ln -s b a
++ git update-index --add a
+++ git write-tree
++ t4=79c8f43fc2b6210c5badb2c13595654b6c40b974
++ rm -f .git/index
++ git read-tree 79c8f43fc2b6210c5badb2c13595654b6c40b974
++ git checkout-index --temp -a
+++ wc -l
++ test 1 = 1
+++ cut '-d ' -f2 out
++ test a = a
+++ cut '-d ' -f1 out
++ p=.merge_link_RykTWo
++ test -f .merge_link_RykTWo
+++ cat .merge_link_RykTWo
++ test b = b
+ eval_ret=0
+ return 0
+ '[' 0 = 0 -a 0 = 0 ']'
+ test_ok_ 'checkout --temp symlink'
++ expr 17 + 1
+ test_count=18
+ say_color '' ' ok 18: checkout --temp symlink'
+ test -z ''
+ test -n ''
+ shift
+ echo '* ok 18: checkout --temp symlink'
+ echo ''
+ test_done
+ trap - exit
+ test 0 '!=' 0
+ test 0 '!=' 0
+ msg=18 test(s)
+ say_color pass 'passed all 18 test(s)'
+ test -z pass
+ shift
+ echo '* passed all 18 test(s)'
+ exit 0
[-- Attachment #3: stdout.txt --]
[-- Type: text/plain, Size: 5556 bytes --]
* expecting success:
mkdir asubdir &&
echo tree1path0 >path0 &&
echo tree1path1 >path1 &&
echo tree1path3 >path3 &&
echo tree1path4 >path4 &&
echo tree1asubdir/path5 >asubdir/path5 &&
git update-index --add path0 path1 path3 path4 asubdir/path5 &&
t1=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree2path1 >path1 &&
echo tree2path2 >path2 &&
echo tree2path4 >path4 &&
git update-index --add path0 path1 path2 path4 &&
t2=$(git write-tree) &&
rm -f path* .merge_* out .git/index &&
echo tree2path0 >path0 &&
echo tree3path1 >path1 &&
echo tree3path2 >path2 &&
echo tree3path3 >path3 &&
git update-index --add path0 path1 path2 path3 &&
t3=$(git write-tree)
* ok 1: preparation
* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree1path1
* ok 2: checkout one stage 0 to temporary file
* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree $t1 &&
git checkout-index -a --temp >out &&
test $(wc -l <out) = 5 &&
for f in path0 path1 path3 path4 asubdir/path5
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree1$f
done
* ok 3: checkout all stage 0 to temporary files
* expecting success:
rm -f path* .merge_* out .git/index &&
git read-tree -m $t1 $t2 $t3
* ok 4: prepare 3-way merge
* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=2 --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = tree2path1
* ok 5: checkout one stage 2 to temporary file
* expecting success:
rm -f path* .merge_* out &&
git checkout-index --all --stage=2 --temp >out &&
test $(wc -l <out) = 3 &&
for f in path1 path2 path4
do
test $(grep $f out | cut "-d " -f2) = $f &&
p=$(grep $f out | cut "-d " -f1) &&
test -f $p &&
test $(cat $p) = tree2$f
done
* ok 6: checkout all stage 2 to temporary files
* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path0 >out &&
test $(wc -l <out) = 0
* ok 7: checkout all stages/one file to nothing
* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path1 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path1 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)
* ok 8: checkout all stages/one file to temporary files
* expecting success:
rm -f path* .merge_* out &&
git checkout-index --stage=all --temp -- path2 >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = path2 &&
cut "-d " -f1 out | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)
* ok 9: checkout some stages/one file to temporary files
* expecting success:
rm -f path* .merge_* out &&
git checkout-index -a --stage=all --temp >out &&
test $(wc -l <out) = 5
* ok 10: checkout all stages/all files to temporary files
* expecting success:
test x$(grep path0 out | cut "-d " -f2) = x
* ok 11: -- path0: no entry
* expecting success:
test $(grep path1 out | cut "-d " -f2) = path1 &&
grep path1 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s1) = tree1path1 &&
test $(cat $s2) = tree2path1 &&
test $(cat $s3) = tree3path1)
* ok 12: -- path1: all 3 stages
* expecting success:
test $(grep path2 out | cut "-d " -f2) = path2 &&
grep path2 out | cut "-d " -f1 | (read s1 s2 s3 &&
test $s1 = . &&
test -f $s2 &&
test -f $s3 &&
test $(cat $s2) = tree2path2 &&
test $(cat $s3) = tree3path2)
* ok 13: -- path2: no stage 1, have stage 2 and 3
* expecting success:
test $(grep path3 out | cut "-d " -f2) = path3 &&
grep path3 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test -f $s3 &&
test $(cat $s1) = tree1path3 &&
test $(cat $s3) = tree3path3)
* ok 14: -- path3: no stage 2, have stage 1 and 3
* expecting success:
test $(grep path4 out | cut "-d " -f2) = path4 &&
grep path4 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test -f $s2 &&
test $s3 = . &&
test $(cat $s1) = tree1path4 &&
test $(cat $s2) = tree2path4)
* ok 15: -- path4: no stage 3, have stage 1 and 3
* expecting success:
test $(grep asubdir/path5 out | cut "-d " -f2) = asubdir/path5 &&
grep asubdir/path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f $s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat $s1) = tree1asubdir/path5)
* ok 16: -- asubdir/path5: no stage 2 and 3 have stage 1
* expecting success:
(cd asubdir &&
git checkout-index -a --stage=all >out &&
test $(wc -l <out) = 1 &&
test $(grep path5 out | cut "-d " -f2) = path5 &&
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
test -f ../$s1 &&
test $s2 = . &&
test $s3 = . &&
test $(cat ../$s1) = tree1asubdir/path5)
)
* ok 17: checkout --temp within subdir
* expecting success:
rm -f path* .merge_* out .git/index &&
ln -s b a &&
git update-index --add a &&
t4=$(git write-tree) &&
rm -f .git/index &&
git read-tree $t4 &&
git checkout-index --temp -a >out &&
test $(wc -l <out) = 1 &&
test $(cut "-d " -f2 out) = a &&
p=$(cut "-d " -f1 out) &&
test -f $p &&
test $(cat $p) = b
* ok 18: checkout --temp symlink
* passed all 18 test(s)
^ 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