# [cogito-0.18.2] Documentation/Code Mismatch: cg-switch -l

2 messages from 2008-05-26 to 2008-05-26. Participants: Mark Lawrence, Andreas Ericsson.
Thread: https://gitlist.dev/t/13669

## Mark Lawrence, 2008-05-26 11:18

Subject: [cogito-0.18.2] Documentation/Code Mismatch: cg-switch -l
Message-ID: <20080526111837.GA17429@lifebook.rekudos.net>
URL: https://gitlist.dev/e/20080526111837.GA17429%40lifebook.rekudos.net

```
Hi,

I don't know if this is a bug or just my understanding, but I'm having
trouble matching the behaviour of "cg-switch -l" with the documentation.

According to the docs, -l means that:
                                                ... local changes will
  be "kept" with your previous branch, you will get a pristine tree of
  the new branch and when you switch back to the original branch you
  will also get back the local changes.

However if I run "cg-switch -l -c testing" on a dirty (ie with local
changes) repository I do not get a pristine tree. In fact, it appears 
the local changes are carried over.

Initial state:

    mlawren@lifebook:/tmp/x$ cg-status
    Heads:
        >master     6a8a774cd1fb84f48f906a9ce3322a5ac94deb00
       R origin     cdc9a7857b93b00f515b010c9aeadda4e649b92a

    ? Changes
    ? META.yml
    ? Makefile
    ? blib/
    ? inc/
    ? pm_to_blib
    ? t/benchmark.pl
    ? t/cache.t
    ? t/hyphens.t
    ? t/synopsis.t
    ? x
    M MANIFEST
    M Makefile.PL
    M debian/changelog
    M debian/control
    M lib/XML/API.pm
    A lib/XML/API/Cache.pm
    M lib/XML/API/RSS.pm
    M lib/XML/API/XHTML.pm
    M t/02-langs.t
    M t/03-XML-API.t
    A t/04-parse.t

Create a new local branch and check status:

    mlawren@lifebook:/tmp/x$ cg-switch -l -c testing
    Creating new branch testing: 6a8a774cd1fb84f48f906a9ce3322a5ac94deb00
    Switching to branch testing...

    mlawren@lifebook:/tmp/x$ cg-status
    Heads:
        master     6a8a774cd1fb84f48f906a9ce3322a5ac94deb00
      R origin     cdc9a7857b93b00f515b010c9aeadda4e649b92a
        >testing    6a8a774cd1fb84f48f906a9ce3322a5ac94deb00

    ? Changes
    ? META.yml
    ? Makefile
    ? blib/
    ? inc/
    ? pm_to_blib
    ? t/benchmark.pl
    ? t/cache.t
    ? t/hyphens.t
    ? t/synopsis.t
    ? x
    M MANIFEST
    M Makefile.PL
    M debian/changelog
    M debian/control
    M lib/XML/API.pm
    A lib/XML/API/Cache.pm
    M lib/XML/API/RSS.pm
    M lib/XML/API/XHTML.pm
    M t/02-langs.t
    M t/03-XML-API.t
    A t/04-parse.t

Why do I still have all these modified and additional files? I fully
expected to still see the '?' file not under git/cogito control. However
the uncommitted changes are still all present.

I am also confused by the existence of the '-p' option, which by my
reading implies pretty much the same condition as if you *don't* specify
-l.

Regards,
Mark.
-- 
Mark Lawrence

```

## Andreas Ericsson, 2008-05-26 12:19

Subject: Re: [cogito-0.18.2] Documentation/Code Mismatch: cg-switch -l
Message-ID: <483AAAB8.1090705@op5.se>
URL: https://gitlist.dev/e/483AAAB8.1090705%40op5.se
In-Reply-To: <20080526111837.GA17429@lifebook.rekudos.net>

```
Mark Lawrence wrote:
> Hi,
> 
> I don't know if this is a bug or just my understanding, but I'm having
> trouble matching the behaviour of "cg-switch -l" with the documentation.
> 

Cogito became officially unmaintained a very long time ago (late 2006?)
and will almost certainly not work properly with any half-recent version
of git. Don't use it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

```
