[O] git diff: hunk header config
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) (goto-char (match-beginning 1)) (insert " ") (delete-region (point) (1+ (match-beginning 2))) - (setq ncol (max (1+ (current-column)) + (setq ncol (max (current-column) (1+ col) (if (> to-col 0) to-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 to thi (goto-char (match-beginning 1)) (insert " ") (delete-region (point) (1+ (match-beginning 2))) - (setq ncol (max (1+ (current-column)) + (setq ncol (max (current-column) (1+ col) (if (> to-col 0) to-col #+end_src Would that be commonly welcome for at least firstly Emacs Lisp and texinfo? If yes, the following is to be added to the org-mode.git repo: 1) new file .gitattributes: #+begin_src *.eldiff=el *.texi diff=texinfo #+end_src 2) append to .git/config: #+begin_src [diff "el"] xfuncname = "^(\\(def[a-z]+ .+)$" [diff "texinfo"] xfuncname="^(@(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
Re: [O] git diff: hunk header config
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=45938 Michael On Sun, Jul 31, 2011 at 13:49, Michael Brand wrote: > 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) > (goto-char (match-beginning 1)) > (insert " ") > (delete-region (point) (1+ (match-beginning 2))) > - (setq ncol (max (1+ (current-column)) > + (setq ncol (max (current-column) > (1+ col) > (if (> to-col 0) > to-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 to thi > (goto-char (match-beginning 1)) > (insert " ") > (delete-region (point) (1+ (match-beginning 2))) > - (setq ncol (max (1+ (current-column)) > + (setq ncol (max (current-column) > (1+ col) > (if (> to-col 0) > to-col > #+end_src > > Would that be commonly welcome for at least firstly Emacs Lisp and texinfo? > > If yes, the following is to be added to the org-mode.git repo: > > 1) new file .gitattributes: > #+begin_src > *.el diff=el > *.texi diff=texinfo > #+end_src > > 2) append to .git/config: > #+begin_src > [diff "el"] > xfuncname = "^(\\(def[a-z]+ .+)$" > [diff "texinfo"] > xfuncname="^(@(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
Re: [O] git diff: hunk header config
Hi Michael, On Sat, Aug 20, 2011 at 6:12 PM, Michael Brand wrote: > 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? > This is a very useful config. Thanks for pointing it out. But don't you think this is a client side setting? As far as I am aware, settings don't carry over from the remote repository. Its distributed versioning after all. :) To make this a server side setting, you would have to add .git/config and .gitattributes to the repo. But I think that is not correct as many users might have their own settings that will have to be remerged at every update. What do you think? In any case, I think this would be a wonderful addition to org-faq.org on Worg. -- Suvayu Open source is the future. It sets us free.
Re: [O] git diff: hunk header config
Hi folks, suvayu ali writes: > This is a very useful config. Thanks for pointing it out. But don't > you think this is a client side setting? As far as I am aware, > settings don't carry over from the remote repository. Its distributed > versioning after all. :) > > To make this a server side setting, you would have to add .git/config > and .gitattributes to the repo. But I think that is not correct as > many users might have their own settings that will have to be remerged > at every update. I let Jason decide upon this. > What do you think? In any case, I think this would be a wonderful > addition to org-faq.org on Worg. Suvayu, please feel free to add it to Worg! Best, -- Bastien
Re: [O] git diff: hunk header config
On Sat, Aug 20, 2011 at 23:47, suvayu ali wrote: > On Sat, Aug 20, 2011 at 6:12 PM, Michael Brand >> [...] >> "@@ -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" > > [...] > To make this a server side setting, you would have to add .git/config > and .gitattributes to the repo. But I think that is not correct as > many users might have their own settings that will have to be remerged > at every update. According to the git manual there is a cleaner way for local changes: - gitattributes(5) Manual Page: - "Attributes which should be version-controlled and distributed to other repositories (i.e., attributes of interest to all users) should go into .gitattributes files." - "If you wish to affect only a single repository (i.e., to assign attributes to files that are particular to one user’s workflow for that repository), then attributes should be placed in the $GIT_DIR/info/attributes file." - git-config(1) Manual Page: - "$GIT_DIR/config: Repository specific configuration file." and "The .git/config file in each repository is used to store the configuration for that repository" - "~/.gitconfig: User-specific configuration file." and "$HOME/.gitconfig is used to store a per-user configuration as fallback values for the .git/config file." For .gitattributes it seems to be ok to make it a versioned git repo element. Proposal for the content (changed from first post): #+begin_src # This file is intended to be effective for all users of this repository. # Use ".git/info/attributes" for changes specific to the local user(s). *.eldiff=el *.texi diff=texinfo #+end_src For .git/config I am not sure if it can be made a versioned git repo element. If not, I don't know how it can become part of the transfer during git pull which it should be in any case. Proposal for the content (changed from first post): #+begin_src # This file is intended to be effective for all users of this repository. # Use "$HOME/.gitconfig" for changes specific to one user. [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = true [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git://orgmode.org/org-mode.git [branch "master"] remote = origin merge = refs/heads/master [diff "el"] xfuncname = "^(\\(def[a-z]+ .+)$" [diff "texinfo"] xfuncname = "^(@(sub)*section.*)$" #+end_src > What do you think? In any case, I think this would be a wonderful > addition to org-faq.org on Worg. What I would like is that the hunk headers of all future patches from all contributers look like proposed. Without requiring them to change their config now and with every new git clone. For me it is not enough if only a few contributers that stumble upon this FAQ entry and then even care about, change their config. Michael
Re: [O] git diff: hunk header config
Michael Brand writes: > For .git/config I am not sure if it can be made a versioned git repo > element. If not, I don't know how it can become part of the transfer > during git pull which it should be in any case. Proposal for the > content (changed from first post): You can't and I don't think that is an oversight. As a general principle such configurations should not be part of the repository at all. Please note that if you do configure it that way locally, all tools in git will show all diffs in the new format, so there is nothing lost if everybody doesn't have the same configuration. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf Blofeld V1.15B11: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada
Re: [O] git diff: hunk header config
Hi Achim, Jason and Matt On Wed, Aug 24, 2011 at 21:37, Achim Gratz wrote: > Michael Brand writes: >> For .git/config I am not sure if it can be made a versioned git repo >> element. If not, I don't know how it can become part of the transfer >> during git pull which it should be in any case. Proposal for the >> content (changed from first post): > > You can't and I don't think that is an oversight. As a general > principle such configurations should not be part of the repository at > all. Please note that if you do configure it that way locally, all > tools in git will show all diffs in the new format, so there is nothing > lost if everybody doesn't have the same configuration. Thanks for the clarification. Because I didn't expect this at all it took me some time to understand that a local config affects also the diffs already committed, not only "git diff" of uncommitted changes. Neat. But aren't there still things lost when one does this only locally? 1) The web browser view of the git repos http://orgmode.org/w/org-mode.git, its delayed mirror http://repo.or.cz/w/org-mode.git and http://repo.or.cz/w/Worg.git (for code/elisp/): Can be solved by configuring these three repos locally. 2) When reading patches submitted to the mailing list: Here I don't know the solution. In my simple trial, .gitattributes was not available in its clone done afterwards. @Jason and Matt: At least, changing 1) alone would already help. What do you think? Michael
Re: [O] git diff: hunk header config
Michael Brand writes: > Thanks for the clarification. Because I didn't expect this at all it > took me some time to understand that a local config affects also the > diffs already committed, not only "git diff" of uncommitted changes. Git doesn't "commit diffs", which is why this is working (and a frequent source of confusion for people who don't know the architecture of Git). > Neat. One of those things that reassures me that Git has made the right choices. > But aren't there still things lost when one does this only locally? > 1) The web browser view of the git repos >http://orgmode.org/w/org-mode.git, its delayed mirror >http://repo.or.cz/w/org-mode.git and http://repo.or.cz/w/Worg.git >(for code/elisp/): Can be solved by configuring these three >repos locally. I wouldn't know how to configure repo.or.cz (or any other mirror), but it might be worth asking the maintainers of that site if they would consider adding a global configuration. Customizing the (global) configuation on orgmode.org is at Jasons discretion, I guess. > 2) When reading patches submitted to the mailing list: Here I don't >know the solution. In my simple trial, .gitattributes was not >available in its clone done afterwards. Don't read them on the mailing list, then. Apply them in Git and look at them whichever way you want to. Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptations for KORG EX-800 and Poly-800MkII V0.9: http://Synth.Stromeko.net/Downloads.html#KorgSDada