git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: pw/add-p-select, was Re: What's cooking in git.git (Dec 2018, #01; Sun, 9)

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
Dec 10, 2018, 10:42 UTC
Message-ID
<d69259ce-bc45-9201-693b-3902a6379265@talktalk.net>
In-Reply-To
<nycvar.QRO.7.76.6.1812092101570.43@tvgsbejvaqbjf.bet>
Hi Dscho
On 09/12/2018 20:31, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi Junio,
> 
> On Sun, 9 Dec 2018, Junio C Hamano wrote:
> 
>> * pw/add-p-select (2018-07-26) 4 commits
>>   - add -p: optimize line selection for short hunks
>>   - add -p: allow line selection to be inverted
>>   - add -p: select modified lines correctly
>>   - add -p: select individual hunk lines
>>
>>   "git add -p" interactive interface learned to let users choose
>>   individual added/removed lines to be used in the operation, instead
>>   of accepting or rejecting a whole hunk.
>>
>>   Will discard.
>>   No further feedbacks on the topic for quite some time.
> 
> That is not quite true. I did comment that this feature
Sorry I meant to reply to that comment but never got round to it.
> (which I take as
> being inspired by Git GUI's "Stage Selected Line"),

not particularly, I don't use git gui I just wanted a way to easily stage a subset of lines without editing the hunk.

Show 5 quoted lines
> and thought that it would be useful.
> 
> I could imagine, however, that it would make sense for `git add -p` to
> imitate that feature more closely: by allowing to stage a single line and
> then presenting the current hunk (re-computed) again.

that sounds like it would be quite tedious to stage more than a couple of lines, and it could be awkward to get it to stage modified lines correctly (While I was writing the feature I tried git gui, I think it is supposed to be able to stage modified lines correctly but I never persuaded it to do it for me. I also tried gitg, tig and hg commit -i but I couldn't get them to do modified lines either)

I'll try and re-roll in the New Year, when does the outreachy project for converting add -i start? - it would be good to try and get this pinned down before then.

Best Wishes
Phillip
> Ciao,
> Dscho
> 
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 20 in “What's cooking in git.git (Dec 2018, #01; Sun, 9)”
  1. Junio C HamanoDec 9, 2018
  2. Denton LiuDec 9, 2018
  3. Junio C HamanoDec 10, 2018
  4. Denton LiuDec 10, 2018
  5. Junio C HamanoDec 10, 2018
  6. pw/add-p-select, was Re: What's cooking in git.git (Dec 2018, #01; Sun, 9)Johannes Schindelin, Dec 9, 2018
  7. Phillip WoodDec 10, 2018
  8. Johannes SchindelinDec 11, 2018
  9. Phillip WoodDec 11, 2018
  10. Johannes SchindelinJan 21, 2019
  11. Phillip WoodJan 22, 2019
  12. Josh SteadmonDec 10, 2018
  13. Junio C HamanoDec 11, 2018
  14. Elijah NewrenDec 10, 2018
  15. Ævar Arnfjörð BjarmasonDec 10, 2018
  16. Junio C HamanoDec 11, 2018
  17. Junio C HamanoDec 11, 2018
  18. Stefan BellerDec 11, 2018
  19. Junio C HamanoDec 11, 2018
  20. Alban GruinDec 16, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.