git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: Carl Worth <cworth@cworth.org>
Cc: Junio C Hamano <junkio@cox.net>,
	git@vger.kernel.org, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [PATCH] New git-seek command with documentation and test.
Date: Fri, 24 Feb 2006 11:00:29 +0100	[thread overview]
Message-ID: <43FED93D.1000601@op5.se> (raw)
In-Reply-To: <87zmkhrf4y.wl%cworth@cworth.org>

Carl Worth wrote:
> Add git-seek which allows for temporary excursions through the
> revision history. With "git seek <revision>" one gets a working tree
> corresponding to <revision>. When done with the excursion "git seek"
> returns back to the original branch from where the first seek began.
> 

I've said it before, and I'll say it again. This tool provides less 
flexibility and much less power than "git checkout -b branch 
<commit-ish>" (although it would be nice to have '-o' for 'overwrite 
existing branch' as an argument to git checkout)

> Signed-off-by: Carl Worth <cworth@cworth.org>
> 
> ---
>  
>  I had planned to just let this drop as my original need was some
>  historical exploration that I've already finished. But now I've found
>  a common use case in my everyday workflow that could benefit from
>  git-seek. Here it is:
>  
>  I receive a bug-fix patch that updates a test case to demonstrate the
>  bug. I can apply both the fix and the test case and see it succeed.
>  But what I really want to do is first commit the test case, see it
>  fail, and only then commit the fix and see the test now succeed.  I'd
>  also like the history to reflect that order. So what I do is:
>  
>  	$ git-am
>  	$ git update-index test.c ; git commit -m "Update test"
>  	$ git update-index buggy.c ; git commit -m "Fix bug"
>  
>  At that point, without git-seek I can get by with:
>  
>  	$ git checkout -b tmp HEAD^
>  	$ make check # to see failure
>  	$ git checkout <branch_I_was_on_to_begin_with>
>  	$ git branch -d tmp # easy to forget, but breaks the next time otherwise
>  	$ make check # to see success
>  
>  But what I'd really like to do, (and can with the attached patch), is:
>  
>  	$ git seek HEAD^
>  	$ make check # to see failure
>  	$ git seek
>  	$ make check # to see success
>  
>  This avoids me having to:
> 1) invent a throwaway name,

All programmers have at least five throwaway names that are only ever 
used as such (mine are, in order of precedence, foo, bar, tmp, fnurg, 
sdf and asd).

> 2) remember the branch I started on,

With topic branches, you need to pick more careful topic names. Without 
topic branches you're always on "master". Surely you know what the 
patches touch, so you know what branch they should be in.

> 3) remember to actually throwaway the temporary branch.
> 

This isn't always a bad thing, since you after applying some patch or 
other decide you want to go back to this point in history, or want to 
keep the point so you can show the author some problem or other with the 
patch. With git-seek you'll then have to remember the hard-to-learn 
SHA1, or how far below HEAD or some other easily remembered point in 
history it is. In that case, you need to remember to add the 
branch/tag/whatever to where you seeked rather than just go on with the 
work. Removing a branch later is simple. Finding the right spot to 
create it later can be trouble-some.

If I had a vote, I'd say no to this patch, and to this tool entirely.

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

  parent reply	other threads:[~2006-02-24 10:00 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-14 16:28 several quick questions Nicolas Vilz 'niv'
2006-02-14 17:03 ` Andreas Ericsson
2006-02-14 21:30   ` Nicolas Vilz 'niv'
2006-02-14 17:05 ` Linus Torvalds
2006-02-14 17:47   ` Kenneth Johansson
2006-02-14 18:08     ` Andreas Ericsson
2006-02-14 18:21       ` Kenneth Johansson
2006-02-14 18:26     ` Linus Torvalds
2006-02-14 18:10   ` Carl Worth
2006-02-14 18:34     ` Linus Torvalds
2006-02-14 20:10       ` Carl Worth
2006-02-14 20:27         ` Petr Baudis
2006-02-14 20:37           ` Johannes Schindelin
2006-02-14 20:41             ` Junio C Hamano
2006-02-14 20:54               ` Johannes Schindelin
2006-02-14 20:55             ` Petr Baudis
2006-02-14 20:40         ` Linus Torvalds
2006-02-14 21:19           ` Petr Baudis
2006-02-14 21:53           ` Carl Worth
2006-02-14 22:39             ` Junio C Hamano
2006-02-23 20:31               ` [PATCH] New git-seek command with documentation and test Carl Worth
2006-02-24  0:18                 ` J. Bruce Fields
2006-02-24  1:01                   ` [PATCH] git-seek: Eliminate spurious warning. Fix errant reference to git-bisect in docs Carl Worth
2006-02-24  6:02                     ` Junio C Hamano
2006-02-24 10:00                 ` Andreas Ericsson [this message]
2006-02-24 11:38                   ` [PATCH] New git-seek command with documentation and test Junio C Hamano
2006-02-24 14:23                   ` Carl Worth
2006-02-24 21:48                     ` Johannes Schindelin
2006-02-24 21:57                       ` J. Bruce Fields
2006-02-14 21:30         ` several quick questions Josef Weidendorfer
2006-02-14 21:40           ` Junio C Hamano
2006-02-14 22:17             ` Josef Weidendorfer
2006-02-14 22:26               ` Junio C Hamano
2006-02-15 19:22                 ` [PATCH] More useful/hinting error messages in git-checkout Josef Weidendorfer
2006-02-14 23:00             ` several quick questions Andreas Ericsson
2006-02-14 23:23               ` Johannes Schindelin
2006-02-15  0:08                 ` Andreas Ericsson
2006-02-15  0:34                   ` Junio C Hamano
2006-02-15  6:27               ` Junio C Hamano
2006-02-15  9:06                 ` Andreas Ericsson
2006-02-15  9:21                   ` Junio C Hamano
2006-02-14 21:41           ` Petr Baudis
2006-02-14 18:44     ` Carl Worth
2006-02-14 19:00       ` Linus Torvalds
2006-02-14 19:38         ` Andreas Ericsson
2006-02-14 20:34           ` Johannes Schindelin
2006-02-14 20:14         ` Carl Worth
2006-02-14 18:55     ` Keith Packard
2006-02-14 19:04       ` Linus Torvalds
2006-02-14 19:39         ` Keith Packard
     [not found]           ` <20060214220154.GJ31278@pasky.or.cz>
     [not found]             ` <1139960934.4341.93.camel@evo.keithp.com>
     [not found]               ` <20060215000737.GF9573@pasky.or.cz>
     [not found]                 ` <1139963183.4341.117.camel@evo.keithp.com>
2006-02-15  1:12                   ` Cogito turbo-introduction Petr Baudis
2006-02-15  1:32                     ` Petr Baudis
2006-02-15  4:11           ` several quick questions Martin Langhoff
2006-02-15  5:25             ` Keith Packard
2006-02-15  8:21               ` Carl Worth
2006-02-14 19:13     ` Junio C Hamano
2006-02-14 19:46 ` Petr Baudis
  -- strict thread matches above, loose matches on Subject: below --
2006-02-24  0:29 [PATCH] New git-seek command with documentation and test linux
2006-02-24  0:54 ` Johannes Schindelin
2006-02-24  1:23   ` linux
2006-02-24  6:53 ` H. Peter Anvin
2006-02-24 10:11   ` Andreas Ericsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43FED93D.1000601@op5.se \
    --to=ae@op5.se \
    --cc=cworth@cworth.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).