From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: git diff: hunk header config Date: Sat, 20 Aug 2011 18:12:59 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuoAQ-00029Q-Pb for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 12:13:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuoAP-0006Rq-HU for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 12:13:02 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:49545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuoAP-0006Rg-D6 for emacs-orgmode@gnu.org; Sat, 20 Aug 2011 12:13:01 -0400 Received: by wwf10 with SMTP id 10so3135703wwf.30 for ; Sat, 20 Aug 2011 09:13:00 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Cc: Jason Dunsmore , Andrea Crotti , Carsten Dominik Hi all 1) Since there has been no feedback yet I'd like to bump my previous post repeated below. I would like to have the config of the repo orgmode.org/org-mode.git to be extended to support more useful diff hunk headers containing e. g. the prototype of the current function for *.el files. Like "@@ -12991,7 +12991,7 @@ (defun org-align-tags-here (to-col)" instead of the current "@@ -12991,7 +12991,7 @@ If ONOFF is `on' or `off', don't toggle but set to= thi" Can this be done in the repo orgmode.org/org-mode.git at all? Effective for everyone after only git pull? 2) Note: Also a config of git, but for diff of crypted Org files is shown at the end of this recent post: http://thread.gmane.org/gmane.emacs.orgmode/45781/focus=3D45938 Michael On Sun, Jul 31, 2011 at 13:49, Michael Brand w= rote: > Hi all > > I suggest to change the config of git diff in the org-mode.git repo to > the more helpful hunk header (the @@...@@ line) style: > > #+begin_src diff > @@ -12991,7 +12991,7 @@ (defun org-align-tags-here (to-col) > =A0 =A0 =A0 =A0 =A0(goto-char (match-beginning 1)) > =A0 =A0 =A0 =A0 =A0(insert " ") > =A0 =A0 =A0 =A0 =A0(delete-region (point) (1+ (match-beginning 2))) > - =A0 =A0 =A0 =A0 (setq ncol (max (1+ (current-column)) > + =A0 =A0 =A0 =A0 (setq ncol (max (current-column) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(1+ col) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (> to-col 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0to-col > #+end_src > > which is similar to GNU diff -p/--show-c-function. The current, not > configured default "style" is: > > #+begin_src diff > @@ -12991,7 +12991,7 @@ If ONOFF is `on' or `off', don't toggle but set t= o thi > =A0 =A0 =A0 =A0 =A0(goto-char (match-beginning 1)) > =A0 =A0 =A0 =A0 =A0(insert " ") > =A0 =A0 =A0 =A0 =A0(delete-region (point) (1+ (match-beginning 2))) > - =A0 =A0 =A0 =A0 (setq ncol (max (1+ (current-column)) > + =A0 =A0 =A0 =A0 (setq ncol (max (current-column) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(1+ col) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (> to-col 0) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0to-col > #+end_src > > Would that be commonly welcome for at least firstly Emacs Lisp and texinf= o? > > If yes, the following is to be added to the org-mode.git repo: > > 1) new file .gitattributes: > #+begin_src > *.el =A0 =A0diff=3Del > *.texi =A0diff=3Dtexinfo > #+end_src > > 2) append to .git/config: > #+begin_src > [diff "el"] > =A0 =A0 =A0 =A0xfuncname =3D "^(\\(def[a-z]+ .+)$" > [diff "texinfo"] > =A0 =A0 =A0 =A0xfuncname=3D"^(@(sub)*section.*)$" > #+end_src > > I hope that somebody can do this in the repo in such a way that it > will be effective after git pull and git clone automatically, so that > nobody has to care about later. > > Michael