From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Move stripspace() and launch_editor() to strbuf.c
Date: Sun, 11 Nov 2007 22:29:34 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.64.0711112227420.4362@racer.site> (raw)
In-Reply-To: <7vtznsbgcc.fsf@gitster.siamese.dyndns.org>
Hi,
On Sun, 11 Nov 2007, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > These functions are already declared in strbuf.h, so it is only
> > logical to move their implementations to the corresponding file.
> > Particularly, since strbuf.h is in LIB_H, but both functions
> > were missing from libgit.a.
>
> I think this makes sense for stripspace(), but I have trouble
> with launch_editor().
>
> I do not object to have a function in strbuf API that takes a
> buffer, allows the end user to interactively edit its content
> and returns the updated content. The function was perfectly
> fine as a special purpose helper for git-commit and git-tag, but
> if you look at the current launch_editor(), it is not suitable
> as a generic strbuf library function:
>
> * "Launch" feels as if we are initiating an async operation and
> returning from the function without waiting for its
> completion, but this is not "launch" but "launch, wait and
> return the resulting string". Probably this should be called
> edit_buffer() or something like that.
>
> * Instead of dying, it should return exit code and have the
> caller choose to die or take any alternative action. The
> library function definitely should not say "if you are in an
> environment where we cannot let you interactively edit, use
> -F or -m option".
All valid points. Will add to my TODO list and repost when done.
Maybe call_editor() instead of edit_buffer()? Since we technically read
the file specified by "path" into the buffer "buffer", after having called
the editor.
Ciao,
Dscho
next prev parent reply other threads:[~2007-11-11 22:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-11 17:29 [PATCH] Move stripspace() and launch_editor() to strbuf.c Johannes Schindelin
2007-11-11 21:52 ` Junio C Hamano
2007-11-11 22:29 ` Johannes Schindelin [this message]
2007-11-11 22:52 ` Junio C Hamano
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=Pine.LNX.4.64.0711112227420.4362@racer.site \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).