git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Oakley <philipoakley@iee.email>
To: David Aguilar <davvid@gmail.com>
Cc: Andre Ulrich <andre.ulrich@smail.fh-koeln.de>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	Johannes Sixt <j6t@kdbg.org>,
	Git Mailing List <git@vger.kernel.org>,
	Pratyush Yadav <pratiy0100@gmail.com>
Subject: Re: fast forward merge overwriting my code
Date: Sun, 30 May 2021 12:00:58 +0100	[thread overview]
Message-ID: <75d301b3-3cbe-da2e-6611-1bf32a187284@iee.email> (raw)
In-Reply-To: <CAJDDKr4GFcV4MSUP+Ku=B1JjZieKwwwuGgsb8yssc0vg0thFQA@mail.gmail.com>

On 30/05/2021 06:31, David Aguilar wrote:
> On Mon, May 24, 2021 at 11:51 AM Philip Oakley <philipoakley@iee.email> wrote:
>> adding Pratyush for the Git Gui stash suggestion..
>> [...]
>>>>> So my Question is: is there any possibility, to be able to view (and
>>>>> even edit, if necessary) the changed notebook in the merging process
>>>>> (as in my example with the 3way merge)?
>>>> I'm not aware of such a mechanism (as simply described) but I'm sure
>>>> there are ways to use the "staging area" view (e.g. via the Git-gui) to
>>>> selectively pick out hunks and lines that are staged (and non-selected
>>>> hunk/lines stashed) to give a testable worktree during the 'merge'.
>>> Ah ok, this could be an idea (it would requiere some more research, as
>>> I haven't used the git gui before (I want to learn everything from the
>>> scratch using the command line))
>> I commonly use the Gui when picking apart a large commit into smaller
>> ones when I'm happy that there's no overlaps. Small patches make for
>> easier merging and fault finding, and better commit messages (good
>> thesis practice)
>>
>>> But to be honest, I think even this approach might already be too
>>> cumbersome (as this selectively picking and stashing sounds like a lot
>>> of work itself).
>> Unfortunately the Git Gui doesn't have a menu for stashing remaining
>> changes, but it's simple to flip over to the terminal to stash from
>> there to do the testing, and un-stash the remainder afterwards - I'll
>> maybe suggest the gui could include that capability for these types of
>> workflows (cc Pratyush Yadav <pratiy0100@gmail.com>).
> Tangential, and doesn't apply in this use case, but I should mention
> that Git Cola[1] has had this feature for a while now.

+1. I haven't used/tried Cola myself, so..

>
> Cola's Stash dialog allows you to do a regular stash and the "keep
> index" stash alluded to here. "keep index" retains whatever has
> already been staged.
>
> One feature unique to cola is its "stash the index" feature, which
> will only stash stuff that you've selectively staged. That's for the
> cases where you just want to stash away a small bit, and selectively
> choosing the inverse is a lot of work, so instead you can select just
> the bits you want to be stashed away and stash 'em.

Sounds good.
When I did a quick test (Git-Gui & cli) with staging one line of a two
line change and then stashing, I found that the stash pop failed with a
conflict (your 'lot of work') which I hadn't expected, which to me is
totally wrong (against the spirit of the stash command).

>
> There's no shame in using a GUI for interactive editing. Cola is
> designed to be driven through keyboard interactions so it's easy to
> interactively edit the index without having to use a mouse.
>
> Cola also has affordances that can make learning core Git easier
> (enable its GIT_COLA_TRACE=1 mode in the environment and it'll print
> out every git command it runs).
>
> [1] https://git-cola.github.io/
> [1] https://github.com/git-cola/git-cola
>
> cheers,
Thanks

  reply	other threads:[~2021-05-30 11:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-22 15:48 fast forward merge overwriting my code Andre Ulrich
2021-05-22 17:12 ` Philip Oakley
2021-05-23 15:01   ` Junio C Hamano
2021-05-24  9:50     ` Philip Oakley
2021-05-23  9:48 ` Johannes Sixt
2021-05-23 23:58   ` brian m. carlson
2021-05-24  6:13     ` Andre Ulrich
2021-05-24 11:13       ` Bagas Sanjaya
2021-05-24 13:16       ` Philip Oakley
2021-05-24 15:06         ` Andre Ulrich
2021-05-24 18:48           ` Philip Oakley
2021-05-25 15:14             ` Philip Oakley
2021-05-30  5:31             ` David Aguilar
2021-05-30 11:00               ` Philip Oakley [this message]
2021-05-24 17:47       ` Igor Djordjevic
2021-05-26  2:53       ` Felipe Contreras
2021-05-26 11:06         ` Philip Oakley
2021-05-26 18:33           ` Felipe Contreras
2021-05-26 20:35             ` Philip Oakley
2021-05-26 23:34               ` Felipe Contreras
2021-05-27 12:05                 ` Philip Oakley
2021-05-27 14:00                   ` Felipe Contreras
2021-05-27 15:12                     ` Philip Oakley

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=75d301b3-3cbe-da2e-6611-1bf32a187284@iee.email \
    --to=philipoakley@iee.email \
    --cc=andre.ulrich@smail.fh-koeln.de \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=pratiy0100@gmail.com \
    --cc=sandals@crustytoothpaste.net \
    /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).