{"thread":{"id":"11888","subject":"[PATCH 4/4] git-submodule: prepare for the .git-file","startedAt":"2008-02-04T20:59:17Z","lastAt":"2008-02-06T10:35:25Z","messageCount":13,"participants":["Lars Hjemli","Mike Hommey","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"67426","messageId":"1202158761-31211-1-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":null,"subject":"[PATCH 0/4] Introduce the .git-file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T20:59:17Z","receivedAt":"2008-02-04T20:59:17Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"This is a resend of my previous patches + an update to make git-submodule\nwork with the .git-file + a litte documentation.\n\nPS: Regarding the color of the bikeshed, it seems that everyone can live\nwith  \"gitdir:\" so that's what I ended up using.\n\nDiffstat:\n Documentation/repository-layout.txt |    5 ++-\n git-submodule.sh                    |    4 +-\n setup.c                             |   40 +++++++++++++++++++\n t/t0002-gitfile.sh                  |   71 +++++++++++++++++++++++++++++++++++\n 4 files changed, 117 insertions(+), 3 deletions(-)\n"},{"id":"67424","messageId":"1202158761-31211-2-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":"1202158761-31211-1-git-send-email-hjemli@gmail.com","subject":"[PATCH 1/4] Add platform-independent .git \"symlink\"","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T20:59:18Z","receivedAt":"2008-02-04T20:59:18Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"This patch allows .git to be a regular textfile containing the path of\nthe real git directory (formatted like \"gitdir: <path>\\n\"), which is\nuseful on platforms lacking support for real symlinks.\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n setup.c |   40 ++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 40 insertions(+), 0 deletions(-)\n\ndiff --git a/setup.c b/setup.c\nindex adede16..2cbda91 100644\n--- a/setup.c\n+++ b/setup.c\n@@ -239,6 +239,40 @@ static int check_repository_format_gently(int *nongit_ok)\n }\n \n /*\n+ * Try to read the location of the git directory from the .git file,\n+ * return path to git directory if found.\n+ * Format of the .git file is\n+ *    gitdir: <path>\\n\n+ */\n+static const char *read_gitfile_gently(const char *path)\n+{\n+\tstatic char buf[PATH_MAX + 9];  /* \"gitdir: \" + \"\\n\" */\n+\tstruct stat st;\n+\tint fd;\n+\tsize_t len;\n+\n+\tif (stat(path, &st))\n+\t\treturn NULL;\n+\tif (!S_ISREG(st.st_mode) || st.st_size >= sizeof(buf))\n+\t\treturn NULL;\n+\tfd = open(path, O_RDONLY);\n+\tif (fd < 0)\n+\t\treturn NULL;\n+\tlen = read_in_full(fd, buf, sizeof(buf));\n+\tclose(fd);\n+\tif (len != st.st_size)\n+\t\treturn NULL;\n+\tif (!len || buf[len - 1] != '\\n')\n+\t\treturn NULL;\n+\tbuf[len - 1] = '\\0';\n+\tif (prefixcmp(buf, \"gitdir: \"))\n+\t\treturn NULL;\n+\tif (!is_git_directory(buf + 8))\n+\t\treturn NULL;\n+\treturn make_absolute_path(buf + 8);\n+}\n+\n+/*\n  * We cannot decide in this function whether we are in the work tree or\n  * not, since the config can only be read _after_ this function was called.\n  */\n@@ -247,6 +281,7 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \tconst char *work_tree_env = getenv(GIT_WORK_TREE_ENVIRONMENT);\n \tstatic char cwd[PATH_MAX+1];\n \tconst char *gitdirenv;\n+\tconst char *gitfile_dir;\n \tint len, offset;\n \n \t/*\n@@ -302,6 +337,11 @@ const char *setup_git_directory_gently(int *nongit_ok)\n \t */\n \toffset = len = strlen(cwd);\n \tfor (;;) {\n+\t\tgitfile_dir = read_gitfile_gently(DEFAULT_GIT_DIR_ENVIRONMENT);\n+\t\tif (gitfile_dir) {\n+\t\t\tsetenv(GIT_DIR_ENVIRONMENT, gitfile_dir, 1);\n+\t\t\tbreak;\n+\t\t}\n \t\tif (is_git_directory(DEFAULT_GIT_DIR_ENVIRONMENT))\n \t\t\tbreak;\n \t\tif (is_git_directory(\".\")) {\n-- \n1.5.4.5.g25d066\n"},{"id":"67425","messageId":"1202158761-31211-3-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":"1202158761-31211-2-git-send-email-hjemli@gmail.com","subject":"[PATCH 2/4] Document the .git-file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T20:59:19Z","receivedAt":"2008-02-04T20:59:19Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"---\n Documentation/repository-layout.txt |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/repository-layout.txt b/Documentation/repository-layout.txt\nindex 6939130..e9db3a1 100644\n--- a/Documentation/repository-layout.txt\n+++ b/Documentation/repository-layout.txt\n@@ -3,7 +3,10 @@ git repository layout\n \n You may find these things in your git repository (`.git`\n directory for a repository associated with your working tree, or\n-`'project'.git` directory for a public 'bare' repository).\n+`'project'.git` directory for a public 'bare' repository. It is\n+also possible to have a working tree where `.git` is a plain\n+ascii file containing `gitdir: <path>\\n`, i.e. the path to the\n+real git repository).\n \n objects::\n \tObject store associated with this repository.  Usually\n-- \n1.5.4.5.g25d066\n"},{"id":"67423","messageId":"1202158761-31211-4-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":"1202158761-31211-3-git-send-email-hjemli@gmail.com","subject":"[PATCH 3/4] Add tests for .git file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T20:59:20Z","receivedAt":"2008-02-04T20:59:20Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"Verify that the basic plumbing works when .git is a file pointing at\nthe real git directory.\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n t/t0002-gitfile.sh |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 71 insertions(+), 0 deletions(-)\n create mode 100755 t/t0002-gitfile.sh\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nnew file mode 100755\nindex 0000000..f8f39e6\n--- /dev/null\n+++ b/t/t0002-gitfile.sh\n@@ -0,0 +1,71 @@\n+#!/bin/sh\n+\n+test_description='.git file\n+\n+Verify that plumbing commands work when .git is a file\n+'\n+. ./test-lib.sh\n+\n+chkfile() {\n+\tD=$(echo $1 | cut -b 1-2) &&\n+\tF=$(echo $1 | cut -b 3-40) &&\n+\tif test ! -f $REAL/objects/$D/$F\n+\tthen\n+\t\techo \"Object not found: $REAL/objects/$D/$F\"\n+\t\tfalse\n+\tfi\n+}\n+\n+test_expect_success 'setup' '\n+\tREAL=$(pwd)/.real &&\n+\tmv .git $REAL &&\n+\techo \"gitdir: $REAL\" >.git\n+'\n+\n+test_expect_success 'check rev-parse --git-dir' '\n+\ttest \"$REAL\" = \"$(git rev-parse --git-dir)\"\n+'\n+\n+test_expect_success 'check hash-object' '\n+\techo \"foo\" >bar &&\n+\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tchkfile $SHA\n+'\n+\n+test_expect_success 'check cat-file' '\n+\tgit cat-file blob $SHA >actual &&\n+\tdiff -u bar actual\n+'\n+\n+test_expect_success 'check update-index' '\n+\tif test -f $REAL/index\n+\tthen\n+\t\techo \"Hmm, $REAL/index exists?\"\n+\t\tfalse\n+\tfi &&\n+\trm -rf $REAL/objects/* &&\n+\tgit update-index --add bar &&\n+\tif ! test -f $REAL/index\n+\tthen\n+\t\techo \"$REAL/index not found\"\n+\t\tfalse\n+\tfi &&\n+\tchkfile $SHA\n+'\n+\n+test_expect_success 'check write-tree' '\n+\tSHA=$(git write-tree) &&\n+\tchkfile $SHA\n+'\n+\n+test_expect_success 'check commit-tree' '\n+\tSHA=$(echo \"commit bar\" | git commit-tree $SHA) &&\n+\tchkfile $SHA\n+'\n+\n+test_expect_success 'check rev-list' '\n+\techo $SHA >$REAL/HEAD &&\n+\ttest \"$SHA\" = \"$(git rev-list HEAD)\"\n+'\n+\n+test_done\n-- \n1.5.4.5.g25d066\n"},{"id":"67422","messageId":"1202158761-31211-5-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":"1202158761-31211-4-git-send-email-hjemli@gmail.com","subject":"[PATCH 4/4] git-submodule: prepare for the .git-file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T20:59:21Z","receivedAt":"2008-02-04T20:59:21Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"When git-submodule tried to detect 'active' submodules, it checked for the\nexistence of a directory named '.git'. This isn't good enough now that .git\ncan be a file pointing to the real $GIT_DIR so the tests are changed to\nreflect this.\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n git-submodule.sh |    4 ++--\n 1 files changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex a6aaf40..220d64c 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -288,7 +288,7 @@ cmd_update()\n \t\t\tcontinue\n \t\tfi\n \n-\t\tif ! test -d \"$path\"/.git\n+\t\tif ! test -e \"$path\"/.git\n \t\tthen\n \t\t\tmodule_clone \"$path\" \"$url\" || exit\n \t\t\tsubsha1=\n@@ -362,7 +362,7 @@ cmd_status()\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n \t\turl=$(git config submodule.\"$name\".url)\n-\t\tif test -z \"url\" || ! test -d \"$path\"/.git\n+\t\tif test -z \"url\" || ! test -e \"$path\"/.git\n \t\tthen\n \t\t\tsay \"-$sha1 $path\"\n \t\t\tcontinue;\n-- \n1.5.4.5.g25d066\n"},{"id":"67438","messageId":"20080204222304.GA15178@glandium.org","threadId":"11888","inReplyTo":"1202158761-31211-5-git-send-email-hjemli@gmail.com","subject":"Re: [PATCH 4/4] git-submodule: prepare for the .git-file","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-02-04T22:23:04Z","receivedAt":"2008-02-04T22:23:04Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Feb 04, 2008 at 09:59:21PM +0100, Lars Hjemli wrote:\n> -\t\tif ! test -d \"$path\"/.git\n> +\t\tif ! test -e \"$path\"/.git\n\nIs test -e supported by all shells we support ? I have some doubts...\n\nMike\n"},{"id":"67444","messageId":"8c5c35580802041444y7bda301ctc8ff8df6cc0587a1@mail.gmail.com","threadId":"11888","inReplyTo":"20080204222304.GA15178@glandium.org","subject":"Re: [PATCH 4/4] git-submodule: prepare for the .git-file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-04T22:44:39Z","receivedAt":"2008-02-04T22:44:39Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Feb 4, 2008 11:23 PM, Mike Hommey <mh@glandium.org> wrote:\n> On Mon, Feb 04, 2008 at 09:59:21PM +0100, Lars Hjemli wrote:\n> > -             if ! test -d \"$path\"/.git\n> > +             if ! test -e \"$path\"/.git\n>\n> Is test -e supported by all shells we support ? I have some doubts...\n>\n\nI dunno, but we already use it two other places in git-submodule.\n\nI guess we can rewrite it to something like\n  test -d $path || test -f $path || test -L $path || exist=0\nif needed.\n\n-- \nlh\n"},{"id":"67607","messageId":"7vfxw66a0s.fsf@gitster.siamese.dyndns.org","threadId":"11888","inReplyTo":"1202158761-31211-4-git-send-email-hjemli@gmail.com","subject":"Re: [PATCH 3/4] Add tests for .git file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T03:25:55Z","receivedAt":"2008-02-06T03:25:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lars Hjemli <hjemli@gmail.com> writes:\n\n> Verify that the basic plumbing works when .git is a file pointing at\n> the real git directory.\n>\n> Signed-off-by: Lars Hjemli <hjemli@gmail.com>\n> ---\n>  t/t0002-gitfile.sh |   71 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 files changed, 71 insertions(+), 0 deletions(-)\n>  create mode 100755 t/t0002-gitfile.sh\n>\n> diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\n> new file mode 100755\n> index 0000000..f8f39e6\n> --- /dev/null\n> +++ b/t/t0002-gitfile.sh\n> @@ -0,0 +1,71 @@\n> +#!/bin/sh\n> +\n> +test_description='.git file\n> +\n> +Verify that plumbing commands work when .git is a file\n> +'\n> +. ./test-lib.sh\n> +\n> +chkfile() {\n> +\tD=$(echo $1 | cut -b 1-2) &&\n> +\tF=$(echo $1 | cut -b 3-40) &&\n> +\tif test ! -f $REAL/objects/$D/$F\n\n\tP=$(echo $1 | sed -e 's|\\(..\\)\\(.*\\)|\\1/\\2\\|') &&\n        if test ! -f \"$REAL/objects/$P\"\n\t\t...\n\nAlthough it probably is more efficient to do this with one\nprocess, s/cut/sed/ is mostly a style issue.\n\nBe careful with quoting.  $REAL might contain a $IFS whitespace\nas you grabbed it from $(pwd)...\n\n> +test_expect_success 'setup' '\n> +\tREAL=$(pwd)/.real &&\n> +\tmv .git $REAL &&\n> +\techo \"gitdir: $REAL\" >.git\n> +'\n> ...\n> +test_expect_success 'check update-index' '\n> +\tif test -f $REAL/index\n> +\tthen\n> +\t\techo \"Hmm, $REAL/index exists?\"\n> +\t\tfalse\n> +\tfi &&\n> +\trm -rf $REAL/objects/* &&\n\n... and it matters especially if you do this ;-)\n"},{"id":"67623","messageId":"1202284583-24478-1-git-send-email-hjemli@gmail.com","threadId":"11888","inReplyTo":"7vfxw66a0s.fsf@gitster.siamese.dyndns.org","subject":"[PATCH 3/4 v2] Add tests for .git file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-06T07:56:23Z","receivedAt":"2008-02-06T07:56:23Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"Verify that the basic plumbing works when .git is a file pointing at\nthe real git directory.\n\nSigned-off-by: Lars Hjemli <hjemli@gmail.com>\n---\n\nThis updated patch replaces cut with sed and tries to do proper quoting.\n\n\n t/t0002-gitfile.sh |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 74 insertions(+), 0 deletions(-)\n create mode 100755 t/t0002-gitfile.sh\n\ndiff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\nnew file mode 100755\nindex 0000000..7f8ee2f\n--- /dev/null\n+++ b/t/t0002-gitfile.sh\n@@ -0,0 +1,74 @@\n+#!/bin/sh\n+\n+test_description='.git file\n+\n+Verify that plumbing commands work when .git is a file\n+'\n+. ./test-lib.sh\n+\n+objpath() {\n+    echo $1 | sed -re 's|(..)(.+)|\\1/\\2|'\n+}\n+\n+objck() {\n+\tp=$(objpath $1)\n+\tif test ! -f \"$REAL/objects/$p\"\n+\tthen\n+\t\techo \"Object not found: $REAL/objects/$p\"\n+\t\tfalse\n+\tfi\n+}\n+\n+test_expect_success 'setup' '\n+\tREAL=\"$(pwd)/.real\" &&\n+\tmv .git \"$REAL\" &&\n+\techo \"gitdir: $REAL\" >.git\n+'\n+\n+test_expect_success 'check rev-parse --git-dir' '\n+\ttest \"$REAL\" = \"$(git rev-parse --git-dir)\"\n+'\n+\n+test_expect_success 'check hash-object' '\n+\techo \"foo\" >bar &&\n+\tSHA=$(cat bar | git hash-object -w --stdin) &&\n+\tobjck $SHA\n+'\n+\n+test_expect_success 'check cat-file' '\n+\tgit cat-file blob $SHA >actual &&\n+\tdiff -u bar actual\n+'\n+\n+test_expect_success 'check update-index' '\n+\tif test -f \"$REAL/index\"\n+\tthen\n+\t\techo \"Hmm, $REAL/index exists?\"\n+\t\tfalse\n+\tfi &&\n+\trm -f \"$REAL/objects/$(objpath $SHA)\" &&\n+\tgit update-index --add bar &&\n+\tif ! test -f \"$REAL/index\"\n+\tthen\n+\t\techo \"$REAL/index not found\"\n+\t\tfalse\n+\tfi &&\n+\tobjck $SHA\n+'\n+\n+test_expect_success 'check write-tree' '\n+\tSHA=$(git write-tree) &&\n+\tobjck $SHA\n+'\n+\n+test_expect_success 'check commit-tree' '\n+\tSHA=$(echo \"commit bar\" | git commit-tree $SHA) &&\n+\tobjck $SHA\n+'\n+\n+test_expect_success 'check rev-list' '\n+\techo $SHA >\"$REAL/HEAD\" &&\n+\ttest \"$SHA\" = \"$(git rev-list HEAD)\"\n+'\n+\n+test_done\n-- \n1.5.4.6.g6627\n"},{"id":"67629","messageId":"7v7ihi32bv.fsf@gitster.siamese.dyndns.org","threadId":"11888","inReplyTo":"1202284583-24478-1-git-send-email-hjemli@gmail.com","subject":"Re: [PATCH 3/4 v2] Add tests for .git file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T08:40:20Z","receivedAt":"2008-02-06T08:40:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lars Hjemli <hjemli@gmail.com> writes:\n\n> Verify that the basic plumbing works when .git is a file pointing at\n> the real git directory.\n>\n> Signed-off-by: Lars Hjemli <hjemli@gmail.com>\n> ---\n>\n> This updated patch replaces cut with sed and tries to do proper quoting.\n>\n>\n>  t/t0002-gitfile.sh |   74 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n>  1 files changed, 74 insertions(+), 0 deletions(-)\n>  create mode 100755 t/t0002-gitfile.sh\n>\n> diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\n> new file mode 100755\n> index 0000000..7f8ee2f\n> --- /dev/null\n> +++ b/t/t0002-gitfile.sh\n> @@ -0,0 +1,74 @@\n> +#!/bin/sh\n> +\n> +test_description='.git file\n> +\n> +Verify that plumbing commands work when .git is a file\n> +'\n> +. ./test-lib.sh\n> +\n> +objpath() {\n> +    echo $1 | sed -re 's|(..)(.+)|\\1/\\2|'\n> +}\n\n\"sed -r\"???  Please limit ourselves to the basics.\n\n> +test_expect_success 'check commit-tree' '\n> +\tSHA=$(echo \"commit bar\" | git commit-tree $SHA) &&\n> +\tobjck $SHA\n> +'\n> +\n> +test_expect_success 'check rev-list' '\n> +\techo $SHA >\"$REAL/HEAD\" &&\n> +\ttest \"$SHA\" = \"$(git rev-list HEAD)\"\n> +'\n\nNicely done.\n"},{"id":"67638","messageId":"8c5c35580802060130i12fc261aqbe9c136f26218188@mail.gmail.com","threadId":"11888","inReplyTo":"7v7ihi32bv.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/4 v2] Add tests for .git file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-06T09:30:16Z","receivedAt":"2008-02-06T09:30:16Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Feb 6, 2008 9:40 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Lars Hjemli <hjemli@gmail.com> writes:\n> > +objpath() {\n> > +    echo $1 | sed -re 's|(..)(.+)|\\1/\\2|'\n> > +}\n>\n> \"sed -r\"???  Please limit ourselves to the basics.\n\nSorry, I didn't realize 'sed -r' wasn't kosher. Should I resend or is\nthis something you'd --amend?\n\n--\nlarsh\n"},{"id":"67648","messageId":"7vr6fqz939.fsf@gitster.siamese.dyndns.org","threadId":"11888","inReplyTo":"8c5c35580802060130i12fc261aqbe9c136f26218188@mail.gmail.com","subject":"Re: [PATCH 3/4 v2] Add tests for .git file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-02-06T10:13:14Z","receivedAt":"2008-02-06T10:13:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Lars Hjemli\" <hjemli@gmail.com> writes:\n\n> On Feb 6, 2008 9:40 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Lars Hjemli <hjemli@gmail.com> writes:\n>> > +objpath() {\n>> > +    echo $1 | sed -re 's|(..)(.+)|\\1/\\2|'\n>> > +}\n>>\n>> \"sed -r\"???  Please limit ourselves to the basics.\n>\n> Sorry, I didn't realize 'sed -r' wasn't kosher. Should I resend or is\n> this something you'd --amend?\n\nIf we live in POSIX only world it is fine, but I try to be\nconservative when I am able.\n\nNo need to resend; I've done something like this (there are\nother minor amends).\n\n    diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh\n    new file mode 100755\n    index 0000000..d280663\n    --- /dev/null\n    +++ b/t/t0002-gitfile.sh\n    @@ -0,0 +1,74 @@\n    +#!/bin/sh\n    +\n    +test_description='.git file\n    +\n    +Verify that plumbing commands work when .git is a file\n    +'\n    +. ./test-lib.sh\n    +\n    +objpath() {\n    +    echo \"$1\" | sed -e 's|\\(..\\)|\\1/|'\n    +}\n    + ...\n\nBut the result won't be pushed out til tomorrow morning.\n"},{"id":"67652","messageId":"8c5c35580802060235n52019c16j4404c06d53b47100@mail.gmail.com","threadId":"11888","inReplyTo":"7vr6fqz939.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH 3/4 v2] Add tests for .git file","fromName":"Lars Hjemli","fromEmail":"hjemli@gmail.com","sentAt":"2008-02-06T10:35:25Z","receivedAt":"2008-02-06T10:35:25Z","isPatch":true,"sender":{"key":"hjemli@gmail.com","avatar":null},"body":"On Feb 6, 2008 11:13 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Lars Hjemli\" <hjemli@gmail.com> writes:\n>\n> > On Feb 6, 2008 9:40 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> >> Lars Hjemli <hjemli@gmail.com> writes:\n> >> > +objpath() {\n> >> > +    echo $1 | sed -re 's|(..)(.+)|\\1/\\2|'\n> >> > +}\n> >>\n> >> \"sed -r\"???  Please limit ourselves to the basics.\n> >\n> > Sorry, I didn't realize 'sed -r' wasn't kosher. Should I resend or is\n> > this something you'd --amend?\n>\n> If we live in POSIX only world it is fine, but I try to be\n> conservative when I am able.\n\nOk, good to know that my lack of experience doesn't pollute the codebase ;-)\n\n> No need to resend; I've done something like this (there are\n> other minor amends).\n>...\n>     +objpath() {\n>     +    echo \"$1\" | sed -e 's|\\(..\\)|\\1/|'\n>     +}\n\nThanks.\n--\nlarsh\n"}]}