[Development] How to use `init-repository` properly to clean up the working tree after checking out?

Haowei Hsu hwhsu1231 at gmail.com
Sun Aug 20 21:18:24 CEST 2023


Hello, Thiago. Thanks for your reply.

If the screenshots are too small for you to see, you can click/download
the attachment I uploaded:

   - *log-init-repository-not-able-to-clean-up.txt*
   - *log-my-approach-to-clean-up.txt*

Because those screenshots are taken from them.

---
Haowei Hsu

Thiago Macieira <thiago.macieira at intel.com> 於 2023年8月21日 週一 上午2:49寫道:

> On Sunday, 20 August 2023 10:41:37 PDT Haowei Hsu wrote:
> > However, I found that even after I run *`perl init-repository -f`* and
> then
> > running *`git status`*
> > again, the working tree is still not clean.
>
> Use "git submodule update --recursive" instead
>
> > Currently, whenever I check out to another branch/tag, I use the
> following
> > two commands to
> > clean up the working tree:
> >
> >    1. *git submodule update --recursive *
> >    2. *git clean -xfdf && git submodule foreach --recursive git clean
> -xfdf*
>
> Like that. The git clean shouldn't be necessary if you build each module
> individually and thus don't build what you don't need. Do not build the
> top
> dir unless you're prepared to fix the issues.
>
> > 6. *git status*
> >
> > You can see the attachment with the full log:
> > *log-my-approach-to-clean-up.txt*
> >
> > [image: image.png]
> >
> > As we can see, my approach seems not able to clean up the working tree in
> > this situation as well.
>
> (I can't see anything because you're taking screenshots of text)
>
> If you want to fix the issues, go into those dirs, do a git status and
> find out
> why Git thinks they're unclean compared to what the submodule link says
> they
> should be at. Then take action.
>
> > Therefore, I'd like to ask:
> > *how to use `init-repository` properly to clean up the working tree after
> > checking out?*
>
> You don't. The tool is not designed for that.
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Cloud Software Architect - Intel DCAI Cloud Engineering
> --
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230821/033c7fb3/attachment-0001.htm>


More information about the Development mailing list