# [PATCH] git-fetch: print the new and old ref when fast-forwarding

3 messages from 2006-02-25 to 2006-02-25. Participants: Lukas Sandström, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/3462

## Lukas Sandström, 2006-02-25 11:20

Subject: [PATCH] git-fetch: print the new and old ref when fast-forwarding
Message-ID: <44003D6D.2010406@etek.chalmers.se>
URL: https://gitlist.dev/e/44003D6D.2010406%40etek.chalmers.se

```
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>

---
This is useful when you check out new changes with gitk.
Just copy/paste the old ref into gitk from the terminal.

 git-fetch.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

78f2844c17bb8627e84389e3026906d074c43363
diff --git a/git-fetch.sh b/git-fetch.sh
index fcc24f8..a3e2a34 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -164,6 +164,7 @@ fast_forward_local () {
 		;;
 	    *,$local)
 		echo >&2 "* $1: fast forward to $3"
+		echo >&2 "  from $local to $2"
 		git-update-ref "$1" "$2" "$local"
 		;;
 	    *)
-- 
1.2.3.gc412

```

## Johannes Schindelin, 2006-02-25 20:08

Subject: Re: [PATCH] git-fetch: print the new and old ref when fast-forwarding
Message-ID: <Pine.LNX.4.63.0602252107110.17999@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0602252107110.17999%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <44003D6D.2010406@etek.chalmers.se>

```
Hi,

On Sat, 25 Feb 2006, Lukas Sandström wrote:

> This is useful when you check out new changes with gitk.
> Just copy/paste the old ref into gitk from the terminal.

Why does "gitk ORIG_HEAD..HEAD" not work? (It also does the correct thing 
when pulling...)

Hth,
Dscho

```

## Junio C Hamano, 2006-02-25 20:53

Subject: Re: [PATCH] git-fetch: print the new and old ref when fast-forwarding
Message-ID: <7vlkvz6tyr.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vlkvz6tyr.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.63.0602252107110.17999@wbgn013.biozentrum.uni-wuerzburg.de>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> This is useful when you check out new changes with gitk.
>> Just copy/paste the old ref into gitk from the terminal.
>
> Why does "gitk ORIG_HEAD..HEAD" not work? (It also does the correct thing 
> when pulling...)

For most projects and repositories with single interesting head,
that would work just fine.

If you use additional Pull: lines to track more than one remote
refs, this patch would help.

For example, if you are tracking my "next" while keeping an eye
on my "master" and "pu", your .git/remotes/origin file may have
something like this:

	URL: git://git.kernel.org/pub/scm/git/git.git
        Pull: next:origin
        Pull: master:ko-master
        Pull: pu:ko-pu

When "git pull origin" pulls my next branch into your current
branch (typically "master"), it also fast forwards your tracking
branches ko-master and ko-pu.  If you want to see what I merged
in the meantime, you would want to get the old value of
ko-master and the new value and feed them to gitk (or git log).
ORIG_HEAD in this case was the old value of _your_ current
branch head, and is not useful to see what happened to my master
branch.

```
