threads / discuss / 11502

Problem with git ls-files

Subject: Problem with git ls-files

## tl;dr

3 messages between Jan 7, 2008 and Jan 7, 2008.

replies: 2people: 1as markdown or json

Imran M Yousuf· Jan 7, 2008, 04:38 UTC · lore
Hi all,

I am facing a strange problem with git ls-files in git-submodule. When I do - echo in modules init with "$@" - `git-ls-files --stage` - `git ls-files --stage -- "$@" | grep -e '^160000 '` - `pwd` The output is =

in modules init with d - 100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt - - /home/imyousuf/projects/git-projs/test/super-project/a

If we format the above output of git list-files --stage we can see the following

100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt

In the output please note the path /home/imyousuf/projects/git-projs/test/super-project/a

Now I am providing the output of - ls -al /home/imyousuf/projects/git-projs/test/super-project/a

 drwxr-xr-x 4 imyousuf imyousuf 4096 2008-01-07 10:22 .
 drwxr-xr-x 6 imyousuf imyousuf 4096 2008-01-07 10:22 ..
 -rw-r--r-- 1 imyousuf imyousuf  130 2008-01-07 10:22 a.txt
 drwxr-xr-x 2 imyousuf imyousuf 4096 2008-01-07 10:22 d
 drwxr-xr-x 8 imyousuf imyousuf 4096 2008-01-07 10:22 .git
 -rw-r--r-- 1 imyousuf imyousuf   95 2008-01-07 10:22 .gitmodules

Now this is getting really confusing for me, because I get the strange output when I call the git submodule from shell script but after the shell script is executed if I do the same command copy and paste in gnome-terminal it works fine.

Can someone please tell me what I am doing wrong?
Thank you,
Imran
Imran M Yousuf· Jan 7, 2008, 04:48 UTC · re: Imran M Yousuf · lore

Re: Problem with git ls-files

For output of git-ls-files is

100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt

Sorry for the mistake earlier.

The pastes are also available here. http://git.pastebin.com/f632762aa

Please help.
Best regards & thank you,
Imran
On Jan 7, 2008 10:38 AM, Imran M Yousuf <imyousuf@gmail.com> wrote:
Show 48 quoted lines
> Hi all,
>
> I am facing a strange problem with git ls-files in git-submodule. When I do -
> echo in modules init with "$@" - `git-ls-files --stage` - `git
> ls-files --stage -- "$@" | grep -e '^160000 '` - `pwd`
> The output is =
>
> in modules init with d - 100644
> c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules 160000
> 091158296a8f57322f70f3c17e5fcb66687a0970 0 a 160000
> 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b 160000
> c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c 100644
> e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt - -
> /home/imyousuf/projects/git-projs/test/super-project/a
>
> If we format the above output of git list-files --stage we can see the following
>
> 100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules
> 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a
> 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b
> 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt
>
> In the output please note the path
> /home/imyousuf/projects/git-projs/test/super-project/a
>
> Now I am providing the output of -
> ls -al /home/imyousuf/projects/git-projs/test/super-project/a
>
>  drwxr-xr-x 4 imyousuf imyousuf 4096 2008-01-07 10:22 .
>  drwxr-xr-x 6 imyousuf imyousuf 4096 2008-01-07 10:22 ..
>  -rw-r--r-- 1 imyousuf imyousuf  130 2008-01-07 10:22 a.txt
>  drwxr-xr-x 2 imyousuf imyousuf 4096 2008-01-07 10:22 d
>  drwxr-xr-x 8 imyousuf imyousuf 4096 2008-01-07 10:22 .git
>  -rw-r--r-- 1 imyousuf imyousuf   95 2008-01-07 10:22 .gitmodules
>
>
> Now this is getting really confusing for me, because I get the strange
> output when I call the git submodule from shell script but after the
> shell script is executed if I do the same command copy and paste in
> gnome-terminal it works fine.
>
> Can someone please tell me what I am doing wrong?
>
> Thank you,
>
> Imran
>
-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557
Imran M Yousuf· Jan 7, 2008, 05:42 UTC · re: Imran M Yousuf · lore

Re: Problem with git ls-files

Hi All,

I though I should also provide the steps to recreate the scenario. Please create a repo using the sample-repo.txt file. Now you can clone the test-repo/super-project using the attached git-clone script with the command -

git-clone -w <path-to>/test-repo/super-project

If the attached git-submodule is used you will be able to see the output of the git-ls-files --stage.

I am eagerly waiting for your help; please HELP.
Best regards & Thank you,
Imran
On Jan 7, 2008 10:48 AM, Imran M Yousuf <imyousuf@gmail.com> wrote:
Show 80 quoted lines
> For output of git-ls-files is
>
> 100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules
> 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a
> 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b
> 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c
> 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt
>
> Sorry for the mistake earlier.
>
> The pastes are also available here.
> http://git.pastebin.com/f632762aa
>
> Please help.
>
> Best regards & thank you,
>
> Imran
>
>
> On Jan 7, 2008 10:38 AM, Imran M Yousuf <imyousuf@gmail.com> wrote:
> > Hi all,
> >
> > I am facing a strange problem with git ls-files in git-submodule. When I do -
> > echo in modules init with "$@" - `git-ls-files --stage` - `git
> > ls-files --stage -- "$@" | grep -e '^160000 '` - `pwd`
> > The output is =
> >
> > in modules init with d - 100644
> > c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules 160000
> > 091158296a8f57322f70f3c17e5fcb66687a0970 0 a 160000
> > 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b 160000
> > c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c 100644
> > e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt - -
> > /home/imyousuf/projects/git-projs/test/super-project/a
> >
> > If we format the above output of git list-files --stage we can see the following
> >
> > 100644 c462997b94c371248bf17895ee18e7fbea5bce9b 0 .gitmodules
> > 160000 091158296a8f57322f70f3c17e5fcb66687a0970 0 a
> > 160000 6397239aeb662ba96f61b59ccc0a0d0812f48435 0 b
> > 160000 c9f0a7dedcb4a9daf5a68c37109577d7d177e10b 0 c
> > 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0 main.txt
> >
> > In the output please note the path
> > /home/imyousuf/projects/git-projs/test/super-project/a
> >
> > Now I am providing the output of -
> > ls -al /home/imyousuf/projects/git-projs/test/super-project/a
> >
> >  drwxr-xr-x 4 imyousuf imyousuf 4096 2008-01-07 10:22 .
> >  drwxr-xr-x 6 imyousuf imyousuf 4096 2008-01-07 10:22 ..
> >  -rw-r--r-- 1 imyousuf imyousuf  130 2008-01-07 10:22 a.txt
> >  drwxr-xr-x 2 imyousuf imyousuf 4096 2008-01-07 10:22 d
> >  drwxr-xr-x 8 imyousuf imyousuf 4096 2008-01-07 10:22 .git
> >  -rw-r--r-- 1 imyousuf imyousuf   95 2008-01-07 10:22 .gitmodules
> >
> >
> > Now this is getting really confusing for me, because I get the strange
> > output when I call the git submodule from shell script but after the
> > shell script is executed if I do the same command copy and paste in
> > gnome-terminal it works fine.
> >
> > Can someone please tell me what I am doing wrong?
> >
> > Thank you,
> >
> > Imran
> >
>
>
>
> --
> Imran M Yousuf
> Entrepreneur & Software Engineer
> Smart IT Engineering
> Dhaka, Bangladesh
> Email: imran@smartitengineering.com
> Mobile: +880-1711402557
>
-- 
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@smartitengineering.com
Mobile: +880-1711402557


mkdir test-repo
cd test-repo/
mkdir submodules
mkdir submodules/a 
mkdir submodules/b
cd submodules/a/
touch a.txt; echo sample text for a.txt >> ./a.txt; git-init; git-add a.txt; git-commit -a -m "First commit on a"
cd ../b/
touch b.txt; echo sample text for b.txt >> ./b.txt; git-init; git-add b.txt; git-commit -a -m "First commit on b"
cd ../a/
git-submodule add ../b/; git-commit -a -m "committing with submodule b"
cd ../../
mkdir super-project
cd super-project/
touch main.txt; echo sample text for main.txt >> ./main.txt; git-init; git-add main.txt; git-submodule add ../submodules/a; git-commit -a -m "First commit on super project";

← back to recent threads