1. 16 10月, 2008 2 次提交
  2. 23 9月, 2008 1 次提交
  3. 19 9月, 2008 1 次提交
    • B
      diff.*.xfuncname which uses "extended" regex's for hunk header selection · 45d9414f
      Brandon Casey 提交于
      Currently, the hunk headers produced by 'diff -p' are customizable by
      setting the diff.*.funcname option in the config file. The 'funcname' option
      takes a basic regular expression. This functionality was designed using the
      GNU regex library which, by default, allows using backslashed versions of
      some extended regular expression operators, even in Basic Regular Expression
      mode. For example, the following characters, when backslashed, are
      interpreted according to the extended regular expression rules: ?, +, and |.
      As such, the builtin funcname patterns were created using some extended
      regular expression operators.
      
      Other platforms which adhere more strictly to the POSIX spec do not
      interpret the backslashed extended RE operators in Basic Regular Expression
      mode. This causes the pattern matching for the builtin funcname patterns to
      fail on those platforms.
      
      Introduce a new option 'xfuncname' which uses extended regular expressions,
      and advertise it _instead_ of funcname. Since most users are on GNU
      platforms, the majority of funcname patterns are created and tested there.
      Advertising only xfuncname should help to avoid the creation of non-portable
      patterns which work with GNU regex but not elsewhere.
      
      Additionally, the extended regular expressions may be less ugly and
      complicated compared to the basic RE since many common special operators do
      not need to be backslashed.
      
      For example, the GNU Basic RE:
      
          ^[ 	]*\\(\\(public\\|static\\).*\\)$
      
      becomes the following Extended RE:
      
          ^[ 	]*((public|static).*)$
      Signed-off-by: NBrandon Casey <casey@nrlssc.navy.mil>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      45d9414f
  4. 11 9月, 2008 1 次提交
    • A
      Use compatibility regex library for OSX/Darwin · 3632cfc2
      Arjen Laarhoven 提交于
      The standard libc regex library on OSX does not support alternation
      in POSIX Basic Regular Expression mode.  This breaks the diff.funcname
      functionality on OSX.
      
      To fix this, we use the GNU regex library which is already present in
      the compat/ diretory for the MinGW port.  However, simply adding compat/
      to the COMPAT_CFLAGS variable causes a conflict between the system
      fnmatch.h and the one present in compat/.  To remedy this, move the
      regex and fnmatch functionality to their own subdirectories in compat/
      so they can be included seperately.
      Signed-off-by: NArjen Laarhoven <arjen@yaph.org>
      Tested-by: Mike Ralphson <mike@abacus.co.uk> (AIX)
      Tested-by: Johannes Sixt <johannes.sixt@telecom.at> (MinGW)
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3632cfc2
  5. 14 7月, 2008 1 次提交
  6. 24 5月, 2008 1 次提交
  7. 23 11月, 2007 1 次提交
  8. 07 7月, 2007 1 次提交
    • J
      Fix configuration syntax to specify customized hunk header patterns. · e0e324a4
      Junio C Hamano 提交于
      This updates the hunk header customization syntax.  The special
      case 'funcname' attribute is gone.
      
      You assign the name of the type of contents to path's "diff"
      attribute as a string value in .gitattributes like this:
      
      	*.java diff=java
      	*.perl diff=perl
      	*.doc diff=doc
      
      If you supply "diff.<name>.funcname" variable via the
      configuration mechanism (e.g. in $HOME/.gitconfig), the value is
      used as the regexp set to find the line to use for the hunk
      header (the variable is called "funcname" because such a line
      typically is the one that has the name of the function in
      programming language source text).
      
      If there is no such configuration, built-in default is used, if
      any.  Currently there are two default patterns: default and java.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e0e324a4
  9. 06 7月, 2007 1 次提交
    • J
      Per-path attribute based hunk header selection. · f258475a
      Junio C Hamano 提交于
      This makes"diff -p" hunk headers customizable via gitattributes mechanism.
      It is based on Johannes's earlier patch that allowed to define a single
      regexp to be used for everything.
      
      The mechanism to arrive at the regexp that is used to define hunk header
      is the same as other use of gitattributes.  You assign an attribute, funcname
      (because "diff -p" typically uses the name of the function the patch is about
      as the hunk header), a simple string value.  This can be one of the names of
      built-in pattern (currently, "java" is defined) or a custom pattern name, to
      be looked up from the configuration file.
      
        (in .gitattributes)
        *.java   funcname=java
        *.perl   funcname=perl
      
        (in .git/config)
        [funcname]
          java = ... # ugly and complicated regexp to override the built-in one.
          perl = ... # another ugly and complicated regexp to define a new one.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      f258475a