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

Re: For all you darcs lovers: git-hunk-commit

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Dec 6, 2006, 00:36 UTC
Message-ID
<Pine.LNX.4.63.0612060129310.28348@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<45760CA3.9060003@xs4all.nl>
Hi,
On Wed, 6 Dec 2006, Han-Wen Nienhuys wrote:
Show 26 quoted lines
> This is the interactive interface for commits in Darcs. It uses the
> same interface for pushing and pulling, where I mostly use y/n/a/d but
> sometimes the other letters too.
> 
> 
> ****
> Shall I record this change? (1/?)  [ynWsfqadjkc], or ? for help: ?
> How to use record...
> y: record this patch
> n: don't record it
> w: wait and decide later, defaulting to no
> 
> s: don't record the rest of the changes to this file
> f: record the rest of the changes to this file
> 
> d: record selected patches, skipping all the remaining patches
> a: record all the remaining patches
> q: cancel record
> 
> j: skip to next patch
> k: back up to previous patch
> c: calculate number of patches
> h or ?: show this help
> 
> <Space>: accept the current default (which is capitalized)
> ****

All but "y" and "n" are unsupported in hunk-commit.bash... Do you use all of these?

> If you want to get a feel for it, grab darcs and run
I already grabbed darcs a long time ago. And run, I did.
Show 7 quoted lines
> > done < <(git ls-files --modified -z)
> 
> > 	done < <(git diff "$filename")
> 
> > 	done < <(echo ${hunks[$index]} | tr , '\n')
> 
> am I running the wrong bash? it barf on this. Don't you mean $(echo ... )

I hoped that I did not use a too new bash. Unfortunately, I seem to have been wrong. These constructs redirect the output of the command as input to the while loop, because

	bla | while ...; do blub; done

opens a subshell, so that all changes done in "blub" are lost as soon as the while loop is finished.

> Frankly, I am amazed that people write things in bash at all--I vowed 
> never to write bash again a couple of years ago.  If you start doing 
> arrays and counting, wouldn't a more high-level language be suitable?

Me, being one of the loudest proponents of C builtins on this list, I agree fully.

But in this case, bash was faster to script and debug, and unless people speak up, saying "I want that feature badly!", I do not plan to do anything with it.

Ciao, Dscho

Previous: Han-Wen NienhuysNext: Matthias Kestenholz
Message 3 of 5 in “For all you darcs lovers: git-hunk-commit”
  1. Johannes SchindelinDec 5, 2006
  2. Han-Wen NienhuysDec 6, 2006
  3. Johannes SchindelinDec 6, 2006
  4. Matthias KestenholzDec 8, 2006
  5. Johannes SchindelinDec 8, 2006

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.