git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: git@vger.kernel.org
Subject: Re: For all you darcs lovers: git-hunk-commit
Date: Wed, 06 Dec 2006 01:19:47 +0100	[thread overview]
Message-ID: <45760CA3.9060003@xs4all.nl> (raw)
In-Reply-To: <Pine.LNX.4.63.0612051936480.28348@wbgn013.biozentrum.uni-wuerzburg.de>

Johannes Schindelin escreveu:
> I was inspired by Han-Wen. This script allows you to commit selected hunks 

Wow!

> In darcs mode, all hunks are presented one by one, and you are asked if 
> you want to commit this or not. If you make a mistake: ^C and back to 
> start. I do not really know darcs, so this might not be how it works -- I 
> did not find any good documentation how a "darcs record" looks like.


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)
****



If you want to get a feel for it, grab darcs and run

  darcs init
  echo hello > hello
  darcs add
  darcs record
  

For a really neat implementation of per-hunk commits, try running
darcsum in Emacs


> 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 ... )

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?

-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

  reply	other threads:[~2006-12-06  0:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-05 18:48 For all you darcs lovers: git-hunk-commit Johannes Schindelin
2006-12-06  0:19 ` Han-Wen Nienhuys [this message]
2006-12-06  0:36   ` Johannes Schindelin
2006-12-08  8:55     ` Matthias Kestenholz
2006-12-08 15:37       ` Johannes Schindelin

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=45760CA3.9060003@xs4all.nl \
    --to=hanwen@xs4all.nl \
    --cc=git@vger.kernel.org \
    /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).