unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Mike Mattie <codermattie@gmail.com>
To: emacs-devel@gnu.org
Subject: vc-bzr sha1sum dependency
Date: Tue, 21 Apr 2009 10:26:04 -0700	[thread overview]
Message-ID: <20090421172603.GB6265@reforged> (raw)

[-- Attachment #1: Type: text/plain, Size: 1904 bytes --]

I was recently bit by the fact that vc-bzr uses sha1sum, and external program
to compute the state of a file in vc-bzr-state-heuristic.

This depedency is suprising and buried rather deep. I looked at the code in question
and discovered that vc-bzr is picking apart an internal bzr file to find the state
of a file, bypassing the now expensive call to bzr status.

When the sha1sum program is not found a signal is thrown in a vc find-file hook.
This interruption produces a error message, but also causes the buffer to not appear.

The buffer has been created actually, but the switch to the buffer is not reached due
to the signal. Even worse if you do find the buffer then the vc mode line updates
produce regular errors, and even saving a file was difficult.

On digging a bit further I also realized that the [backend]-state-heuristic is a part
of the vc API, and it looks to me like it is scoped to implement work-arounds for
"stay local" like functionality for revision control systems that do not support
offline as well.

I wrote a quick fix for vc-bzr, and I have included that patch.  It is
however a band-aid solution. It creates a new vc-bzr-state-heuristic function
that switches between the "fast"/heuristic and "slow"/status paths.

After some more thought this sort of a fix might belong in the middle
layer: vc-hooks.  If the error trap and code path switch is
implemented there the backend heuristic functions would have a
real error path, which is needed assuming that they are assumed brittle by
their design role.

Another and possibly parallel solution is to merge a C implementation of sha1
into Emacs itself, which is probably a good idea as well.

Your thoughts are appreciated, and I am willing to reform the patch as necessary,
inclusive of the feedback from the list.



-- 
GnuPG Key: B9012279 is available from HKP server pgp.mit.edu

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

             reply	other threads:[~2009-04-21 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-21 17:26 Mike Mattie [this message]
2009-04-21 20:24 ` vc-bzr sha1sum dependency Leo
2009-04-23 21:04 ` Thien-Thi Nguyen

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090421172603.GB6265@reforged \
    --to=codermattie@gmail.com \
    --cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).