From mboxrd@z Thu Jan 1 00:00:00 1970 From: Duy Nguyen Subject: Re: [PATCH 2/3] rebase: accept - as another way of saying HEAD~ Date: Mon, 3 Mar 2014 17:04:27 +0700 Message-ID: References: <1393506078-7310-1-git-send-email-pclouds@gmail.com> <1393728794-29566-1-git-send-email-pclouds@gmail.com> <1393728794-29566-3-git-send-email-pclouds@gmail.com> <53144881.6090702@alum.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: Michael Haggerty , Eric Sunshine , Git List , Jeff King , Philip Oakley To: Matthieu Moy X-From: git-owner@vger.kernel.org Mon Mar 03 11:05:08 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WKPkC-0007Dh-Cn for gcvg-git-2@plane.gmane.org; Mon, 03 Mar 2014 11:05:08 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754083AbaCCKFA (ORCPT ); Mon, 3 Mar 2014 05:05:00 -0500 Received: from mail-qg0-f51.google.com ([209.85.192.51]:58592 "EHLO mail-qg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbaCCKE6 (ORCPT ); Mon, 3 Mar 2014 05:04:58 -0500 Received: by mail-qg0-f51.google.com with SMTP id q108so10793259qgd.10 for ; Mon, 03 Mar 2014 02:04:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=0QAYuz9DTQzm+WLu9oEPcypTL/afHKjldTrcz0j8Ih8=; b=NfnInlyxQzsdtHAmCwSpKmrCIUL+pfTrSf0HeaROTRPQ7EpAZUSuPWhHyznSS04+9p W05tgqx1WX1OtGSiyaAIoraHU3c/D6vIhM8ga04Ci+Hc5ap1Dma0OxmibW3eU+grhGxO UUPMYDxXU6zuJaXH4+WAE25J40n7JcILLG5B+VERUqY5cxE9qinz53I9joDzzmFpoOa5 rFPofjbaxKu03Gy48sTnAuKpC5A9Ozyae7N3KOLla8paJ+jhtR38hRVf1rvHqkOMapI1 Iq573e5I+tuGxYpxiTUBVxguKyVERKgBrZhA0QTMYMG/JI5c69fVwzqDGlUo/K+1MlwG 1zKg== X-Received: by 10.140.40.5 with SMTP id w5mr21136476qgw.65.1393841097832; Mon, 03 Mar 2014 02:04:57 -0800 (PST) Received: by 10.96.215.102 with HTTP; Mon, 3 Mar 2014 02:04:27 -0800 (PST) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Mon, Mar 3, 2014 at 4:37 PM, Matthieu Moy wrote: > Michael Haggerty writes: > >> Or perhaps "-NUM" should fail with an error message if any of the last >> NUM commits are merges. In that restricted scenario (which probably >> accounts for 99% of rebases), "-NUM" is equivalent to "HEAD~NUM". > > Makes sense to me. So, -NUM would actually mean "rebase the last NUM > commits" (as well as being an alias for HEAD~NUM), but would fail when > it does not make sense (with an error message explaining the situation > and pointing the user to HEAD~N if this is what he wanted). Agreed, but.. > This would actually be a feature for me: I often want to rebase "recent > enough" history, and when my @{upstream} isn't well positionned, I > randomly type HEAD~N without remembering what N should be. When N is too > small, the rebase doesn't reach the interesting commit, and when N is > too big, it reaches a merge commit and I get a bunch of commits I'm not > allowed to edit in my todo-list. Then I have to abort the commit > manually. With -N failing on merge commits, the rebase would abort > itself automatically. would "git rebase -i --fork-point" be what you need instead? It's a new thing, but may be what we actually should use, not this -NUM.. -- Duy