git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce.org>
To: "Karl Hasselström" <kha@treskal.com>
Cc: Julian Phillips <julian@quantumfyre.co.uk>,
	Matthieu Moy <Matthieu.Moy@imag.fr>,
	git@vger.kernel.org
Subject: Re: [FAQ?] Rationale for git's way to manage the index
Date: Tue, 8 May 2007 10:52:49 -0400	[thread overview]
Message-ID: <20070508145249.GP11311@spearce.org> (raw)
In-Reply-To: <20070508073739.GA24409@diana.vm.bytemark.co.uk>

Karl Hasselstr??m <kha@treskal.com> wrote:
> It's currently possible to split some hunks by
> reducing the number of content lines, but if the changes aren't
> separated by any unchanged lines at all, that doesn't work.

Yea, I've played that game before too (reduce content lines) to
try and simulate a hunk splitter.  ;-)  Doesn't always work.

Right now I feel like a huge chunk of the git-gui code is simply not
maintainable.  The 0.7.0 release is really more about refactoring the
code to make it more maintainable, than it is about actual features
(though there are some new things, like vi-keys).

The hunk selection stuff is just one part of the 2,000 lines
still left in git-gui.sh itself, and that still uses a lot of
messy globals.  I want to get the code better organized before
I take on major new additions to it.

> > I also want to let you revert hunks from the working directory copy.
> 
> That would be handy. But unlike stage/unstage, this can lose
> information, so there'd need to be some kind of "are you _really_
> sure? [Yes] [No]" safety hatch, which would make it less convenient.

True, but that beats the tar out of copying the - lines to your
clipboard and pasting them into your text editor, then deleting
the - prefix.  Especially if its a couple of hunks that you want
to revert.  Which I find myself doing all to often.

Actually I work around it today by staging what I care about,
then reverting the file.  Since the revert comes out of the index,
I get (mostly) the same action as reverting a particular hunk.
But it does mean that I lose my index state, if that happened to
be of any particular interest.

> I assume that shelves would be implemented as branches that are
> precisely one commit on top of HEAD? If so, I'd just like to point out
> that they're exactly like unapplied patches in StGIT.

I haven't looked at StGIT in a while.  I've seen noise on the list
about nifty features being added, but I haven't kept up with what
those features actually are.  I think you are right about this and
maybe git-gui should try to be compatible with StGIT's unapplied
patches, should I get into actually implementing a shelving system.
 
> Hmm. I find it inconsistent to force or strongly encourage the user to
> commit precisely the working directory changes and not a subset
> thereof, which the shelf idea seems to encourage, while at the same
> time not committing straight from the working directory but from a
> specific staging area (the index).

Indeed; I was thinking that this very morning.  Making an index that
you stage things into, but then also saying you cannot really do that
and instead have to shelve what you don't want - that's just evil.
I'll have to think about it more.

The blame interface in git-gui needs help more than the index
staging features.  The colors suck.  ;-)
 
-- 
Shawn.

  reply	other threads:[~2007-05-08 14:53 UTC|newest]

Thread overview: 71+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-06 16:10 [FAQ?] Rationale for git's way to manage the index Matthieu Moy
2007-05-06 16:51 ` Johannes Schindelin
2007-05-06 17:34   ` Matthieu Moy
2007-05-06 17:43     ` Junio C Hamano
2007-05-09 12:52       ` Petr Baudis
2007-05-09 13:57         ` Johannes Schindelin
2007-05-09 14:24           ` [PATCH] git-commit: Reformat log messages provided on commandline Petr Baudis
2007-05-09 14:59             ` Matthieu Moy
2007-05-09 15:11               ` Petr Baudis
2007-05-09 15:32                 ` Matthieu Moy
2007-05-09 15:01             ` Johannes Schindelin
2007-05-10  0:45             ` Junio C Hamano
2007-05-12  0:25               ` Jakub Narebski
2007-05-06 18:22     ` [FAQ?] Rationale for git's way to manage the index Dana How
2007-05-06 23:42     ` Johannes Schindelin
2007-05-06 17:25 ` Linus Torvalds
2007-05-06 18:23   ` Matthieu Moy
2007-05-06 19:54     ` Linus Torvalds
2007-05-06 22:53     ` Julian Phillips
2007-05-07  6:35       ` Karl Hasselström
2007-05-08  1:41         ` Shawn O. Pearce
2007-05-08  7:15           ` Johannes Sixt
2007-05-08 10:28             ` Karl Hasselström
2007-05-08 12:40               ` J. Bruce Fields
2007-05-08 14:53                 ` Karl Hasselström
2007-05-09  3:45                   ` J. Bruce Fields
2007-05-09  9:40                     ` Johannes Schindelin
2007-05-08  7:37           ` Karl Hasselström
2007-05-08 14:52             ` Shawn O. Pearce [this message]
2007-05-06 23:51     ` Johannes Schindelin
2007-05-07  8:02       ` Matthieu Moy
2007-05-07 11:05         ` Johannes Schindelin
2007-05-09 13:07           ` Petr Baudis
2007-05-08  3:16     ` Martin Langhoff
2007-05-08  4:45       ` Linus Torvalds
2007-05-08  5:35         ` Martin Langhoff
2007-05-09 13:41         ` Petr Baudis
2007-05-09 15:52           ` Linus Torvalds
2007-05-09 16:29             ` Carl Worth
2007-05-11  1:28               ` Jakub Narebski
     [not found]                 ` <7vd518gkyo.fsf@assigned-by-dhcp.cox.net>
2007-05-11 11:26                   ` Jakub Narebski
2007-05-11 16:45                     ` Junio C Hamano
2007-05-11 23:06                       ` Jakub Narebski
2007-05-12  0:40                         ` Junio C Hamano
2007-05-12  1:06                           ` Jakub Narebski
2007-05-12  9:35                           ` Jakub Narebski
2007-05-09 16:33             ` Dana How
2007-05-09 17:18               ` J. Bruce Fields
2007-05-09 17:26                 ` Petr Baudis
2007-05-09 17:29                   ` J. Bruce Fields
2007-05-09 17:39             ` Daniel Barkalow
2007-05-09 18:16               ` Linus Torvalds
2007-05-10  0:31             ` Junio C Hamano
2007-05-10  2:27               ` Steven Grimm
2007-05-10  2:39                 ` Linus Torvalds
2007-05-10  8:00                   ` Matthieu Moy
2007-05-10 22:06               ` Shawn O. Pearce
2007-05-10 22:51                 ` Petr Baudis
2007-05-08 11:07       ` Johannes Schindelin
2007-05-15  1:00         ` David Kågedal
2007-05-15 23:27           ` Johannes Schindelin
2007-05-09 17:18     ` Matthieu Moy
2007-05-07 11:40 ` Guilhem Bonnefille
2007-05-07 12:16   ` Karl Hasselström
2007-05-07 12:36     ` David Kastrup
2007-05-07 12:55   ` Johannes Schindelin
2007-05-07 19:31     ` Junio C Hamano
2007-05-09 13:14     ` Petr Baudis
2007-05-07 22:23   ` Daniel Barkalow
2007-05-15  0:57   ` David Kågedal
2007-05-15  8:29     ` Karl Hasselström

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

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

  git send-email \
    --in-reply-to=20070508145249.GP11311@spearce.org \
    --to=spearce@spearce.org \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=julian@quantumfyre.co.uk \
    --cc=kha@treskal.com \
    /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.
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 NNTP newsgroup(s).