# checkout @{-1} bug/oddity

3 messages from 2009-04-19 to 2009-04-20. Participants: Adeodato Simó, Thomas Rast.
Thread: https://gitlist.dev/t/18955

## Adeodato Simó, 2009-04-19 15:37

Subject: checkout @{-1} bug/oddity
Message-ID: <20090419153740.GA12431@chistera.yi.org>
URL: https://gitlist.dev/e/20090419153740.GA12431%40chistera.yi.org

```
In case this is worth fixing:

  | % g co -b foo
  | Switched to a new branch 'foo'
  | 
  | % g co -
  | Switched to branch 'master'
  | 
  | % g co -b bar
  | Switched to a new branch 'bar'
  | 
  | % g co bar
  | Already on 'bar'
  | 
  | % g co -
  | Already on 'bar'

In my opinion the last command should switch to master, as in, switching
to the current branch should not lose the @{-1} history.

Thanks,

-- 
- Are you sure we're good?
- Always.
        -- Rory and Lorelai

```

## Thomas Rast, 2009-04-19 20:36

Subject: Re: checkout @{-1} bug/oddity
Message-ID: <200904192236.32554.trast@student.ethz.ch>
URL: https://gitlist.dev/e/200904192236.32554.trast%40student.ethz.ch
In-Reply-To: <20090419153740.GA12431@chistera.yi.org>

```
Adeodato Simó wrote:
>   | % g co bar
>   | Already on 'bar'
>   | 
>   | % g co -
>   | Already on 'bar'
> 
> In my opinion the last command should switch to master, as in, switching
> to the current branch should not lose the @{-1} history.

This is by analogy with 'cd'.  Try 'cd .; cd -' in the shell.

See

  http://article.gmane.org/gmane.comp.version-control.git/106583

for the original mention; I don't have the time to re-read the entire
thread, but IIRC it was not discussed again.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

```

## Adeodato Simó, 2009-04-20 08:16

Subject: Re: checkout @{-1} bug/oddity
Message-ID: <20090420081650.GA6206@chistera.yi.org>
URL: https://gitlist.dev/e/20090420081650.GA6206%40chistera.yi.org
In-Reply-To: <200904192236.32554.trast@student.ethz.ch>

```
+ Thomas Rast (Sun, 19 Apr 2009 22:36:29 +0200):

> This is by analogy with 'cd'.  Try 'cd .; cd -' in the shell.

> See

>   http://article.gmane.org/gmane.comp.version-control.git/106583

> for the original mention; I don't have the time to re-read the entire
> thread, but IIRC it was not discussed again.

Ok!, thanks for the explanations.

-- 
- Are you sure we're good?
- Always.
        -- Rory and Lorelai

```
