Re: Subject: [PATCH] fix stg edit command

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Peter Oberndorfer <kumbayo84@...>
Cc: Catalin Marinas <catalin.marinas@...>, <git@...>, David <davidk@...>
Date: Tuesday, February 12, 2008 - 6:47 pm

On 2008-02-12 23:05:05 +0100, Peter Oberndorfer wrote:


Thanks for the report. And yes, as far as I can tell your analysis is
spot on. In the initial patch I remember being careful to not replace
cd unless it was actually changed, but obviously I got sloppy after
that. :-(


Yes, you'd definitely want the common operators to work. But I usually
implement __cmp__ instead of __eq__ and __ne__ -- that gives you all
of <, <=, =, !=, >=, and > for the price of a single method. And it's
usually possible to define it rather simply in terms of cmp() with
tuple arguments, like this:

    def __cmp__(self, other):
        return cmp((self.__tree, self.__parents, self.__author,
                    self.__committer, self.__message),
                   (other.__tree, other.__parents, other.__author,
                    other.__committer, other.__message))

This sidesteps the great problem of cmp -- having to remember when to
return 1 and when to return -1.


Yes, this is what we want -- if the user gives --author, we shouldn't
open the interactive editor even if the given author is the same as
the patch already had.

Updated patch on the way.

-- 
Karl Hasselström, kha@treskal.com
      www.treskal.com/kalle
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
StGit: kha/safe and kha/experimental updated, Karl , (Sun Feb 10, 4:36 pm)
Re: StGit: kha/safe and kha/experimental updated, Catalin Marinas, (Tue Feb 12, 1:54 pm)
[StGit PATCH 2/2] Emacs mode: delete patches, Karl , (Sun Feb 10, 4:54 pm)
Re: [StGit PATCH 2/2] Emacs mode: delete patches, David Kågedal, (Mon Feb 11, 5:42 am)
Re: [StGit PATCH 2/2] Emacs mode: delete patches, David Kågedal, (Mon Feb 11, 6:12 am)
Re: [StGit PATCH 5/5] Emacs mode: use "stg new --file", David Kågedal, (Mon Feb 11, 5:25 am)
Subject: [PATCH] fix stg edit command, Peter Oberndorfer, (Tue Feb 12, 6:05 pm)
Re: Subject: [PATCH] fix stg edit command, Karl , (Tue Feb 12, 6:47 pm)