From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B362014F7A for ; Thu, 11 Jan 2024 19:55:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ttaylorr.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ttaylorr.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ttaylorr-com.20230601.gappssmtp.com header.i=@ttaylorr-com.20230601.gappssmtp.com header.b="tSxleAO4" Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-7831386ee01so563227685a.3 for ; Thu, 11 Jan 2024 11:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ttaylorr-com.20230601.gappssmtp.com; s=20230601; t=1705002924; x=1705607724; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=GSheyh076A3gHB7vZ1vhgsrvJ0tdUWLbdfVXSkEFmn0=; b=tSxleAO4+8bTgURmfRDubFJeECK7DzBiXEDj/QPTi2hUFgz353e9y8imwozayxAkjx ue2NZQEdeeOZYGy1mZvJAS8ZWnW5Y5BInlFnTCEeQ2eZWc48ArTtamKI35Bbiun9ni7o MicKZ1bwFriaVntkUEbzB3i9kLLVbUXyjjKTG9HGR6VEBf9s48FWfVpAQhn0MsGg3lV7 oT0DnkVbEIK8rN/7b5/v7zqPAffsmkOn0jepaRy7fhHNoshwX6V5kCfJehiNbUKi+CTi KLjYt6Ayoif9Qt4oLPa5bQzCYKmwR+WtkiQePO8yEN0YhUTH5VyvYAjLPAqqFQlqpaoo AuTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705002924; x=1705607724; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GSheyh076A3gHB7vZ1vhgsrvJ0tdUWLbdfVXSkEFmn0=; b=rFfrvgfXs5nwT+B69Q3vK2hQvtGHoMKJgEl5uJhVZpyjUmclLvMo57E52f5NXzW0h9 6APvkk0wVM2SGQ6CgCp2dnwwMChGeNcHRvGo5Kg6awEMYKDk3OP9bW9GLpv+ZQGRmTFG n8f9DKFQ7EctaqrgAYJvbmns1gX9DDk3Dej/yNNR/fUIeTbqS0UU4sKWOTPFdmJ4D2P8 Jtx/NTaaL220D1xQbxQNx5D9JmfiFtdkP9b/0ac5L04ZloB26zt5Il2qVJrU/NTZjjPn xHrqHpBiTwmnBOoJWcUFOyShwKRV/rdDkDRASxjhhRXv27NWbZgyq+soGQQIXcEVxdP7 dUcA== X-Gm-Message-State: AOJu0YyeYkbL0H3bHUQDFTUOsfUwcDZE72TgaYRAJiHpvuFtbXc8Pxq6 50j1GXeC5Bj44fujn2J5OnhOThsuf9kMV9mvhLv2d0iH6J2X4A== X-Google-Smtp-Source: AGHT+IHiBAQ0Sz39A5zOdbpelLiVbDqzc3ZMh6YhnBSK8kXMRU8Qlf3/b2ToyxrNqUiTr0pMYxPfxA== X-Received: by 2002:a05:622a:1304:b0:429:c8ae:7c4f with SMTP id v4-20020a05622a130400b00429c8ae7c4fmr281316qtk.4.1705002924545; Thu, 11 Jan 2024 11:55:24 -0800 (PST) Received: from localhost (104-178-186-189.lightspeed.milwwi.sbcglobal.net. [104.178.186.189]) by smtp.gmail.com with ESMTPSA id bx3-20020a05622a090300b004299d262017sm696630qtb.66.2024.01.11.11.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 11:55:24 -0800 (PST) Date: Thu, 11 Jan 2024 14:55:14 -0500 From: Taylor Blau To: Chaitanya Tata Cc: git@vger.kernel.org Subject: Re: Add support for `git rebase -no-edit` Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Hi Chaitanya, On Thu, Jan 11, 2024 at 10:55:47PM +0530, Chaitanya Tata wrote: > Hi, > > I have a feature request to add `--no-edit` option to `git rebase` > like we do for `git commit`. > The workflow I typically follow is: > > * `git commit -a --fixup=XXX` > * `git rebase -i HEAD~15 --autosquash` > > But it requires closing the editor without any changes. I can > workaround this using the `GIT_EDITOR` option, see [1]. But it would > be good to have this built-in. The easiest workaround would be setting GIT_EDITOR=true, which matches the recommendation in [1]. Short of that, you can't do a non-interactive rebase, since we rely on the todo list generated by interactive rebases in order for `--autosquash` to work. Presumably plumbing in a new `--[no-]edit` option would be fairly straightforward, and once that is done, the change boils down to just: index 3cc88d8a80..5235a003f2 100644 --- a/sequencer.c +++ b/sequencer.c @@ -6169,7 +6169,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla struct todo_list new_todo = TODO_LIST_INIT; struct strbuf *buf = &todo_list->buf, buf2 = STRBUF_INIT; struct object_id oid = onto->object.oid; - int res; + int res = 0; repo_find_unique_abbrev_r(r, shortonto, &oid, DEFAULT_ABBREV); @@ -6197,8 +6197,9 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla return error(_("nothing to do")); } - res = edit_todo_list(r, todo_list, &new_todo, shortrevisions, - shortonto, flags); + if (!opts->edit) + res = edit_todo_list(r, todo_list, &new_todo, shortrevisions, + shortonto, flags); if (res == -1) return -1; else if (res == -2) { > [1] - https://stackoverflow.com/a/45783848 Thanks, Taylor