[ANNOUNCE] Git v1.7.11.7
A maintenance release Git v1.7.11.7 is now available at the usual places. The release tarballs are found at: http://code.google.com/p/git-core/downloads/list and their SHA-1 checksums are: 30c7aafaa31002ca52bc45dbd0908e63b00015dd git-1.7.11.7.tar.gz bdcd5009498bc961757915dae30f5fefd6435c59 git-htmldocs-1.7.11.7.tar.gz 9fb4bb051822168e41424524a4a325207f308507 git-manpages-1.7.11.7.tar.gz Also the following public repositories all have a copy of the v1.7.11.7 tag and the maint-1.7.11 branch that the tag points at: url = git://repo.or.cz/alt-git.git url = https://code.google.com/p/git-core/ url = git://git.sourceforge.jp/gitroot/git-core/git.git url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core url = https://github.com/gitster/git Git v1.7.11.7 Release Notes === Fixes since v1.7.11.6 - * The synopsis said checkout [-B branch] to make it clear the branch name is a parameter to the option, but the heading for the option description was -B::, not -B branch::, making the documentation misleading. * Git ships with a fall-back regexp implementation for platforms with buggy regexp library, but it was easy for people to keep using their platform regexp. A new test has been added to check this. * git apply -p0 did not parse pathnames on diff --git line correctly. This caused patches that had pathnames in no other places to be mistakenly rejected (most notably, binary patch that does not rename nor change mode). Textual patches, renames or mode changes have preimage and postimage pathnames in different places in a form that can be parsed unambiguously and did not suffer from this problem. * After gitk showed the contents of a tag, neither Reread references nor Reload did not update what is shown as the contents of it, when the user overwrote the tag with git tag -f. * git for-each-ref did not currectly support more than one --sort option. * git log .. errored out saying it is both rev range and a path when there is no disambiguating -- is on the command line. Update the command line parser to interpret .. as a path in such a case. * Pushing to smart HTTP server with recent Git fails without having the username in the URL to force authentication, if the server is configured to allow GET anonymously, while requiring authentication for POST. * git show --format='%ci' did not give timestamp correctly for commits created without human readable name on committer line. (merge e27ddb6 jc/maint-ident-missing-human-name later to maint). * git show --quiet ought to be a synonym for git show -s, but wasn't. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Failing svn imports from apache.org
Does anyone have an idea, what might be wrong here / how to fix it ? Here: git svn --version git-svn version 1.7.12.592.g41e7905 (svn 1.6.18) What's yours? 1.7.9.5 (ubuntu precise) I'm getting Initialized empty Git repository in /tmp/discovery/.git/ Using higher level of URL: http://svn.apache.org/repos/asf/commons/proper/discovery = http://svn.apache.org/repos/asf W: Ignoring error from SVN, path probably does not exist: (160013): Dateisystem hat keinen Eintrag: File not found: revision 100, path '/commons/proper/discovery' W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories and then it checks the revisions. I didn't want to wait for r1301705... Does your git svn abort earlier or after checking all revs? It also scanned through thousands of revisions and then failed: W: Do not be alarmed at the above message git-svn is just searching aggressively for old history. This may take a while on large repositories mkdir .git: No such file or directory at /usr/lib/git-core/git-svn line 3669 cu -- Mit freundlichen Grüßen / Kind regards Enrico Weigelt VNC - Virtual Network Consult GmbH Head Of Development Pariser Platz 4a, D-10117 Berlin Tel.: +49 (30) 3464615-20 Fax: +49 (30) 3464615-59 enrico.weig...@vnc.biz; www.vnc.de -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: What's cooking in git.git (Sep 2012, #05; Fri, 14)
Junio C Hamano wrote: I think we can start thinking about feature freeze once the topics in 'next' that are scheduled to graduate to 'master' already are fully cooked. For any late-coming topic, there always is the next cycle ;-) I've not hear anything about my poll patches and I'd really like them to into 1.8.x. If and when they did, there's another small patch to fully support HP NonStop (some adjustment to git-compat-util.h with #ifdef __TANDEM and a NonStop section in Makefile, so nothing that should have any bad impact on others), which I too would like to get in 1.8.x Bye, Jojo -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] git-gui: Fix semi-working shortcuts for unstage and revert
On Sat, Sep 15, 2012 at 1:36 AM, vi0...@gmail.com wrote: From: Vitaly _Vi Shukela vi0...@gmail.com Make Ctrl+U for unstaging and Ctrl+J for reverting selection behave more like Ctrl+T for adding. They were working only when one area was focused (diff or commit message), now they should work everywhere. Signed-off-by: Vitaly _Vi Shukela vi0...@gmail.com --- Sending the patch the third time (haven't got any replies to previous two attempts). For what its worth: Acked-by: Bert Wesarg bert.wes...@googlemail.com But unless Pat reacts this is useless. Bert git-gui/git-gui.sh |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index ba4e5c1..6618016 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -3710,6 +3710,8 @@ bind $ui_diff $M1B-Key-v {break} bind $ui_diff $M1B-Key-V {break} bind $ui_diff $M1B-Key-a {%W tag add sel 0.0 end;break} bind $ui_diff $M1B-Key-A {%W tag add sel 0.0 end;break} +bind $ui_diff $M1B-Key-j {do_revert_selection;break} +bind $ui_diff $M1B-Key-J {do_revert_selection;break} bind $ui_diff Key-Up {catch {%W yview scroll -1 units};break} bind $ui_diff Key-Down {catch {%W yview scroll 1 units};break} bind $ui_diff Key-Left {catch {%W xview scroll -1 units};break} @@ -3742,6 +3744,8 @@ bind . $M1B-Key-s do_signoff bind . $M1B-Key-S do_signoff bind . $M1B-Key-t do_add_selection bind . $M1B-Key-T do_add_selection +bind . $M1B-Key-u do_unstage_selection +bind . $M1B-Key-U do_unstage_selection bind . $M1B-Key-j do_revert_selection bind . $M1B-Key-J do_revert_selection bind . $M1B-Key-i do_add_all -- 1.7.8.5 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/5] Support matching ** in .gitattributes and .gitignore
A while back I posted a proof of concept using wildmatch() from rsync. Back then the obstacle was case-insensitive matching support. I did not realize that there was iwildmatch() that does exactly that. So here again a series that is probably ready for consumption. Now patterns that contain slashes will always go through (i)wildmatch(). fnmatch() is only used for basename matching. Nguyễn Thái Ngọc Duy (5): Import wildmatch from rsync compat/wildmatch: remove static variable force_lower_case compat/wildmatch: fix case-insensitive matching Integrate wildmatch to git Support ** in .gitignore and .gitattributes patterns using wildmatch() Documentation/gitignore.txt| 3 + Makefile | 6 + attr.c | 4 +- compat/wildmatch.c | 373 + compat/wildmatch.h | 6 + dir.c | 5 +- t/t3070-wildmatch.sh | 27 +++ t/t3070-wildmatch/wildtest.txt | 165 ++ test-wildmatch.c | 228 + 9 files changed, 815 insertions(+), 2 deletions(-) create mode 100644 compat/wildmatch.c create mode 100644 compat/wildmatch.h create mode 100755 t/t3070-wildmatch.sh create mode 100644 t/t3070-wildmatch/wildtest.txt create mode 100644 test-wildmatch.c -- 1.7.12.403.gce5cf6f.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/5] Import wildmatch from rsync
These files are from rsync.git commit d51a3adb4fca3e6b1b046c6e570828f3bca8fe36. The commit is GPL-3. However wildmatch.[ch] have not changed since rsync turned to GPL-3. rsync.git - git.git lib/wildmatch.[ch] compat/wildmatch.[ch] wildtest.c test-wildmatch.c wildtest.txtt/t3070-wildmatch/wildtest.txt Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- compat/wildmatch.c | 368 + compat/wildmatch.h | 6 + t/t3070-wildmatch/wildtest.txt | 165 ++ test-wildmatch.c | 222 + 4 files changed, 761 insertions(+) create mode 100644 compat/wildmatch.c create mode 100644 compat/wildmatch.h create mode 100644 t/t3070-wildmatch/wildtest.txt create mode 100644 test-wildmatch.c diff --git a/compat/wildmatch.c b/compat/wildmatch.c new file mode 100644 index 000..f3a1731 --- /dev/null +++ b/compat/wildmatch.c @@ -0,0 +1,368 @@ +/* +** Do shell-style pattern matching for ?, \, [], and * characters. +** It is 8bit clean. +** +** Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986. +** Rich $alz is now rs...@bbn.com. +** +** Modified by Wayne Davison to special-case '/' matching, to make '**' +** work differently than '*', and to fix the character-class code. +*/ + +#include rsync.h + +/* What character marks an inverted character class? */ +#define NEGATE_CLASS '!' +#define NEGATE_CLASS2 '^' + +#define FALSE 0 +#define TRUE 1 +#define ABORT_ALL -1 +#define ABORT_TO_STARSTAR -2 + +#define CC_EQ(class, len, litmatch) ((len) == sizeof (litmatch)-1 \ +*(class) == *(litmatch) \ +strncmp((char*)class, litmatch, len) == 0) + +#if defined STDC_HEADERS || !defined isascii +# define ISASCII(c) 1 +#else +# define ISASCII(c) isascii(c) +#endif + +#ifdef isblank +# define ISBLANK(c) (ISASCII(c) isblank(c)) +#else +# define ISBLANK(c) ((c) == ' ' || (c) == '\t') +#endif + +#ifdef isgraph +# define ISGRAPH(c) (ISASCII(c) isgraph(c)) +#else +# define ISGRAPH(c) (ISASCII(c) isprint(c) !isspace(c)) +#endif + +#define ISPRINT(c) (ISASCII(c) isprint(c)) +#define ISDIGIT(c) (ISASCII(c) isdigit(c)) +#define ISALNUM(c) (ISASCII(c) isalnum(c)) +#define ISALPHA(c) (ISASCII(c) isalpha(c)) +#define ISCNTRL(c) (ISASCII(c) iscntrl(c)) +#define ISLOWER(c) (ISASCII(c) islower(c)) +#define ISPUNCT(c) (ISASCII(c) ispunct(c)) +#define ISSPACE(c) (ISASCII(c) isspace(c)) +#define ISUPPER(c) (ISASCII(c) isupper(c)) +#define ISXDIGIT(c) (ISASCII(c) isxdigit(c)) + +#ifdef WILD_TEST_ITERATIONS +int wildmatch_iteration_count; +#endif + +static int force_lower_case = 0; + +/* Match pattern p against the a virtually-joined string consisting + * of text and any strings in array a. */ +static int dowild(const uchar *p, const uchar *text, const uchar*const *a) +{ +uchar p_ch; + +#ifdef WILD_TEST_ITERATIONS +wildmatch_iteration_count++; +#endif + +for ( ; (p_ch = *p) != '\0'; text++, p++) { + int matched, special; + uchar t_ch, prev_ch; + while ((t_ch = *text) == '\0') { + if (*a == NULL) { + if (p_ch != '*') + return ABORT_ALL; + break; + } + text = *a++; + } + if (force_lower_case ISUPPER(t_ch)) + t_ch = tolower(t_ch); + switch (p_ch) { + case '\\': + /* Literal match with following character. Note that the test +* in default handles the p[1] == '\0' failure case. */ + p_ch = *++p; + /* FALLTHROUGH */ + default: + if (t_ch != p_ch) + return FALSE; + continue; + case '?': + /* Match anything but '/'. */ + if (t_ch == '/') + return FALSE; + continue; + case '*': + if (*++p == '*') { + while (*++p == '*') {} + special = TRUE; + } else + special = FALSE; + if (*p == '\0') { + /* Trailing ** matches everything. Trailing * matches +* only if there are no more slash characters. */ + if (!special) { + do { + if (strchr((char*)text, '/') != NULL) + return FALSE; + } while ((text = *a++) != NULL); + } + return TRUE; + } + while (1) { + if (t_ch == '\0') { + if ((text = *a++) == NULL) + break; + t_ch = *text; + continue; + } + if ((matched = dowild(p, text, a)) != FALSE) { + if (!special || matched != ABORT_TO_STARSTAR) + return matched; + } else if (!special t_ch == '/') + return
[PATCH 2/5] compat/wildmatch: remove static variable force_lower_case
One place less to worry about thread safety Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- compat/wildmatch.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/compat/wildmatch.c b/compat/wildmatch.c index f3a1731..e824eb2 100644 --- a/compat/wildmatch.c +++ b/compat/wildmatch.c @@ -57,11 +57,10 @@ int wildmatch_iteration_count; #endif -static int force_lower_case = 0; - /* Match pattern p against the a virtually-joined string consisting * of text and any strings in array a. */ -static int dowild(const uchar *p, const uchar *text, const uchar*const *a) +static int dowild(const uchar *p, const uchar *text, + const uchar*const *a, int force_lower_case) { uchar p_ch; @@ -121,7 +120,7 @@ static int dowild(const uchar *p, const uchar *text, const uchar*const *a) t_ch = *text; continue; } - if ((matched = dowild(p, text, a)) != FALSE) { + if ((matched = dowild(p, text, a, force_lower_case)) != FALSE) { if (!special || matched != ABORT_TO_STARSTAR) return matched; } else if (!special t_ch == '/') @@ -291,7 +290,7 @@ int wildmatch(const char *pattern, const char *text) #ifdef WILD_TEST_ITERATIONS wildmatch_iteration_count = 0; #endif -return dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE; +return dowild((const uchar*)pattern, (const uchar*)text, nomore, 0) == TRUE; } /* Match the pattern against the forced-to-lower-case text string. */ @@ -302,9 +301,7 @@ int iwildmatch(const char *pattern, const char *text) #ifdef WILD_TEST_ITERATIONS wildmatch_iteration_count = 0; #endif -force_lower_case = 1; -ret = dowild((const uchar*)pattern, (const uchar*)text, nomore) == TRUE; -force_lower_case = 0; +ret = dowild((const uchar*)pattern, (const uchar*)text, nomore, 1) == TRUE; return ret; } @@ -331,7 +328,7 @@ int wildmatch_array(const char *pattern, const char*const *texts, int where) if (!text) return FALSE; -if ((matched = dowild(p, text, a)) != TRUE where 0 +if ((matched = dowild(p, text, a, 0)) != TRUE where 0 matched != ABORT_ALL) { while (1) { if (*text == '\0') { @@ -339,7 +336,7 @@ int wildmatch_array(const char *pattern, const char*const *texts, int where) return FALSE; continue; } - if (*text++ == '/' (matched = dowild(p, text, a)) != FALSE + if (*text++ == '/' (matched = dowild(p, text, a, 0)) != FALSE matched != ABORT_TO_STARSTAR) break; } -- 1.7.12.403.gce5cf6f.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/5] compat/wildmatch: fix case-insensitive matching
dowild() does case insensitive matching by lower-casing the text. That means lower case letters in patterns imply case-insensitive matching, but upper case means exact matching. We do not want that subtlety. Lower case pattern too so iwildmatch() always does what we expect it to do. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- compat/wildmatch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compat/wildmatch.c b/compat/wildmatch.c index e824eb2..c7f7f9f 100644 --- a/compat/wildmatch.c +++ b/compat/wildmatch.c @@ -81,6 +81,8 @@ static int dowild(const uchar *p, const uchar *text, } if (force_lower_case ISUPPER(t_ch)) t_ch = tolower(t_ch); + if (force_lower_case ISUPPER(p_ch)) + p_ch = tolower(p_ch); switch (p_ch) { case '\\': /* Literal match with following character. Note that the test -- 1.7.12.403.gce5cf6f.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/5] Integrate wildmatch to git
This makes wildmatch.c part of libgit.a and builds test-wildmatch Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Makefile | 6 ++ compat/wildmatch.c | 8 +++- t/t3070-wildmatch.sh | 27 +++ test-wildmatch.c | 8 +++- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100755 t/t3070-wildmatch.sh diff --git a/Makefile b/Makefile index 56301dc..c3608e6 100644 --- a/Makefile +++ b/Makefile @@ -511,6 +511,7 @@ TEST_PROGRAMS_NEED_X += test-sha1 TEST_PROGRAMS_NEED_X += test-sigchain TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe +TEST_PROGRAMS_NEED_X += test-wildmatch TEST_PROGRAMS = $(patsubst %,%$X,$(TEST_PROGRAMS_NEED_X)) @@ -605,6 +606,7 @@ LIB_H += compat/mingw.h LIB_H += compat/obstack.h LIB_H += compat/precompose_utf8.h LIB_H += compat/terminal.h +LIB_H += compat/wildmatch.h LIB_H += compat/win32/dirent.h LIB_H += compat/win32/poll.h LIB_H += compat/win32/pthread.h @@ -709,6 +711,7 @@ LIB_OBJS += combine-diff.o LIB_OBJS += commit.o LIB_OBJS += compat/obstack.o LIB_OBJS += compat/terminal.o +LIB_OBJS += compat/wildmatch.o LIB_OBJS += config.o LIB_OBJS += connect.o LIB_OBJS += connected.o @@ -2586,6 +2589,9 @@ test-svn-fe$X: vcs-svn/lib.a test-%$X: test-%.o GIT-LDFLAGS $(GITLIBS) $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS) +test-wildmatch$X: test-wildmatch.o GIT-LDFLAGS + $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) -lpopt + check-sha1:: test-sha1$X ./test-sha1.sh diff --git a/compat/wildmatch.c b/compat/wildmatch.c index c7f7f9f..625cb0c 100644 --- a/compat/wildmatch.c +++ b/compat/wildmatch.c @@ -9,7 +9,13 @@ ** work differently than '*', and to fix the character-class code. */ -#include rsync.h +#include stddef.h +#include ctype.h +#include string.h + +#include wildmatch.h + +typedef unsigned char uchar; /* What character marks an inverted character class? */ #define NEGATE_CLASS '!' diff --git a/t/t3070-wildmatch.sh b/t/t3070-wildmatch.sh new file mode 100755 index 000..7fb63ff --- /dev/null +++ b/t/t3070-wildmatch.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +test_description='wildmatch tests' + +. ./test-lib.sh + +test_wildmatch() { +test_expect_success wildmatch $* + test-wildmatch $* ../t3070-wildmatch/wildtest.txt actual + echo 'No wildmatch errors found.' expected + test_cmp expected actual + +} + +test_wildmatch -x1 +test_wildmatch -x1 -e1 +test_wildmatch -x1 -else +test_wildmatch -x2 +test_wildmatch -x2 -ese +test_wildmatch -x3 +test_wildmatch -x3 -e1 +test_wildmatch -x4 +test_wildmatch -x4 -e2e +test_wildmatch -x5 +test_wildmatch -x5 -es + +test_done diff --git a/test-wildmatch.c b/test-wildmatch.c index 88585c2..2c506a0 100644 --- a/test-wildmatch.c +++ b/test-wildmatch.c @@ -20,7 +20,13 @@ /*#define COMPARE_WITH_FNMATCH*/ #define WILD_TEST_ITERATIONS -#include lib/wildmatch.c +#include compat/wildmatch.c + +#define MAXPATHLEN 1024 +#ifdef NO_STRLCPY +#include compat/strlcpy.c +#define strlcpy gitstrlcpy +#endif #include popt.h -- 1.7.12.403.gce5cf6f.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/5] Support ** in .gitignore and .gitattributes patterns using wildmatch()
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/gitignore.txt | 3 +++ attr.c | 4 +++- dir.c | 5 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/gitignore.txt b/Documentation/gitignore.txt index c1f692a..eb81d31 100644 --- a/Documentation/gitignore.txt +++ b/Documentation/gitignore.txt @@ -93,6 +93,9 @@ PATTERN FORMAT For example, Documentation/{asterisk}.html matches Documentation/git.html but not Documentation/ppc/ppc.html or tools/perf/Documentation/perf.html. ++ +Contrary to fnmatch(3), git matches ** to anything including +slashes, similar to rsync(1). - A leading slash matches the beginning of the pathname. For example, /{asterisk}.c matches cat-file.c but not diff --git a/attr.c b/attr.c index 3430faf..f06ad95 100644 --- a/attr.c +++ b/attr.c @@ -12,6 +12,7 @@ #include exec_cmd.h #include attr.h #include dir.h +#include compat/wildmatch.h const char git_attr__true[] = (builtin)true; const char git_attr__false[] = \0(builtin)false; @@ -666,7 +667,8 @@ static int path_matches(const char *pathname, int pathlen, return 0; if (baselen != 0) baselen++; - return fnmatch_icase(pattern, pathname + baselen, FNM_PATHNAME) == 0; + return (ignore_case iwildmatch(pattern, pathname + baselen)) || + (!ignore_case wildmatch(pattern, pathname + baselen)); } static int macroexpand_one(int attr_nr, int rem); diff --git a/dir.c b/dir.c index 4868339..c17f9ff 100644 --- a/dir.c +++ b/dir.c @@ -8,6 +8,7 @@ #include cache.h #include dir.h #include refs.h +#include compat/wildmatch.h struct path_simplify { int len; @@ -575,7 +576,9 @@ int excluded_from_list(const char *pathname, namelen -= prefix; } - if (!namelen || !fnmatch_icase(exclude, name, FNM_PATHNAME)) + if (!namelen || + ((ignore_case iwildmatch(exclude, name)) || +(!ignore_case wildmatch(exclude, name return to_exclude; } return -1; /* undecided */ -- 1.7.12.403.gce5cf6f.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?
Hi, Earlier this month I asked how best to handle two branches without a common ancestor to sync changes from one branch to another. Initially I did this via the grafts mechanism, but this wasn't a shared solution, in that the graft was local to my checkout of the repository and no one else's. I read on StackOverflow that git-replace can be used instead. Having read this: http://stackoverflow.com/questions/3810348/setting-git-parent-pointer-to-a-different-parent I followed the instructions to use git-replace. Have successfully done that, I was then able to merge the two branches which didn't have a common ancestor and have the correct commits on the branch I was hoping for. AFAIAC, this worked fine. But now I have some questions: 1. I thought the replace data in .git/refs/replace was published when I did git push so that others could use this information as a base-point, yet it seems not to be the case. How do I publish this? 2. If I do publish it, are there any caveats with that? i.e., because the replace data will likely point to a repo which in my working checkout I added with git-remote, is that going to be a problem? I assume I can instruct people who care, to git remote add foo and then treat master and foo/master as intended? i.e., foo/master will see commits on it over time which master won't have, so git checkout master git merge foo/master can always happen? 3. If it is possible to publish this replace data, is there anything which needs to happen in .git/config either on the bare repo or local checkouts? What I'm aiming for now, in publishing this merge, is that if I can publish the replace data, that people besides me, can clone the repo, and the remote repo in place, and merge the branches as outlined in question 2. What I also am unsure of is whether or not I have to keep updating the replace refs each time I merge the branch? TIA! David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How do I pronounce blob?
On Saturday 2012-09-15 15:24, Yi, EungJun wrote: bee-lob or bla:b? http://en.wiktionary.org/wiki/blob BLOB as a Binary Large OBject reeks of a retronym. I guess bee-lob is correct if it means binary large object. But I'm not sure because gitglossary does not tell me about that. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
How to create the [PATCH 0/5] first email?
The git format-patch allows numbered patches to be created, however I'm not sure how folk generate the initial 0/n patch. Which of the various options should I be using? Also, being on windows, the various 'mbox' and 'MUA' discussions are new to me, so the format-patch step where :- Typically it will be placed in a MUA’s drafts folder, edited to add timely commentary that should not go in the changelog after the three dashes, and then sent as a message whose body, in our example, starts with arch/arm config files were…. On the receiving end, readers can save interesting patches in a UNIX mailbox and apply them with git-am(1). hides a multitude of implicit knowledge steps. Is there an extended description of what that would mean from a platform independent viewpoint? e.g. if the patches are separte files and an mbox is one consolidated file, how to get from one to the other so that 'it' can be sent by 'git send-mail'. I'm also missing an understanding of the preparation stage where one tries to tidy up the various commit messages becaue they weren't explicit, specfic nor concise enough, so I suspect that there is an implicit `git format-patch` - `git am` loop of sharpening the mbox patches before submission to the list that I'm missing. Has this described somewhere? Philip Oakley -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How do I pronounce blob?
Thanks for your help, Jan! On Sat, Sep 15, 2012 at 10:26 PM, Jan Engelhardt jeng...@inai.de wrote: On Saturday 2012-09-15 15:24, Yi, EungJun wrote: bee-lob or bla:b? http://en.wiktionary.org/wiki/blob BLOB as a Binary Large OBject reeks of a retronym. I guess bee-lob is correct if it means binary large object. But I'm not sure because gitglossary does not tell me about that. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to create the [PATCH 0/5] first email?
Philip Oakley philipoak...@iee.org writes: Typically it will be placed in a MUA’s drafts folder, edited to add timely commentary that should not go in the changelog after the three dashes, and then sent as a message whose body, in our example, starts with arch/arm config files were…. On the receiving end, readers can save interesting patches in a UNIX mailbox and apply them with git-am(1). hides a multitude of implicit knowledge steps. Is there an extended description of what that would mean from a platform independent viewpoint? e.g. if the patches are separte files and an mbox is one consolidated file, how to get from one to the other so that 'it' can be sent by 'git send-mail'. If you plan to use git send-email to send the final results out, you should consider git send-email as your MUA in the quoted paragraph. And that will be very platform independent viewpoint to see things from. git format-patch -o my-series/ --cover-letter ... would treat my-series/ directory as MUA's drafts folder and prepares the messages you would want to send out, and you can proof-read and edit the files in there before telling your MUA to send them out, with git send-email ... my-series/*.patch or something. I'm also missing an understanding of the preparation stage where one tries to tidy up the various commit messages becaue they weren't explicit, specfic nor concise enough,... Many people usually do rebase -i until perfection and then a single final invocation of format-patch. Of course, the final can and should further be proof-read and it is fine to do typofixes in the format-patch output files without going back to the commits before sending them out. ...so I suspect that there is an implicit `git format-patch` - `git am` loop of sharpening the mbox patches before submission to the list that I'm missing. Has this described somewhere? -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: What's cooking in git.git (Sep 2012, #05; Fri, 14)
From: Junio C Hamano [mailto:gits...@pobox.com] Sent: Saturday, September 15, 2012 7:01 PM To: Joachim Schmitz Cc: git@vger.kernel.org Subject: Re: What's cooking in git.git (Sep 2012, #05; Fri, 14) Joachim Schmitz j...@schmitz-digital.de writes: Junio C Hamano wrote: I think we can start thinking about feature freeze once the topics in 'next' that are scheduled to graduate to 'master' already are fully cooked. For any late-coming topic, there always is the next cycle ;-) I've not hear anything about my poll patches and I'd really like them to into 1.8.x. I've seen some patches on poll posted, were discussed and had threads titled Re: [PATCH] But I didn't see a rerolled [PATCH v2 n/m] ... series that states that it is a rerolled hopefully final version that addresses all the points that were brought up during the discussion that need to be addressed. I do not necessarily follow all the minute details of all discussion threads. For this particular series, I not know which ones of your poll patches turned out to be unneeded, which ones turned out to be fine as posted originally and which ones needed updating. There were several iterations up to [PATCH v4 n/4] and only one foreign comment to it (and to some commented code) and one self-comment about the order of patches, but none about technical correctness, none that I remember at least. I can post a v5 series which will - move compat/win32/poll.[ch] to compat/poll/ and adjust Makefile - #ifdef some WIN32 specific #include (should this be done in one step with the above?) - fix the 2 bugs in poll.c just like they got fixed in gnulib's version (would you want this in one or two steps?) Bye, Jojo -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How do I pronounce blob?
On Sat, Sep 15, 2012 at 9:24 AM, Yi, EungJun semtlen...@gmail.com wrote: bee-lob or bla:b? Like Bob, add an L in there. m -- martin.langh...@gmail.com mar...@laptop.org -- Software Architect - OLPC - ask interesting questions - don't get distracted with shiny stuff - working code first - http://wiki.laptop.org/go/User:Martinlanghoff -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?
David Chanters david.chant...@googlemail.com writes: 1. I thought the replace data in .git/refs/replace was published when I did git push so that others could use this information as a base-point, yet it seems not to be the case. How do I publish this? If you don't tell it what to push, the command will just update the branches. You can tell git push what you want to push explicitly, e.g. $ git replace -l ;# to learn what replacement I want to send 77d5ba8477eb90509e79dbcf63814a3dfdefb906 $ git push origin refs/replace/77d5ba8477eb90509e79dbcf63814a3dfdefb906 2. If I do publish it, are there any caveats with that? i.e., because the replace data will likely point to a repo which in my working checkout I added with git-remote, is that going to be a problem? That is between you and other project participants. They may not want to see replacement in their project in the first place. Assuming that they do, pushing the replacement ref makes the replacing object available in the pushed-into repository, so they will *not* rely on your repository. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] test-generation.c: Fix a compiler warning
gcc complains as follows: CC test-generation.o test-generation.c: In function `main': test-generation.c:105: warning: control reaches end of \ non-void function In order to suppress the warning, we simply add a suitable return statement to main(). Signed-off-by: Ramsay Jones ram...@ramsay1.demon.co.uk --- Hi Junio, Could you please squash this into commit 1784d096 (test-generation: compute generation numbers and clock skews, 04-09-2012). Thanks! ATB, Ramsay Jones test-generation.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test-generation.c b/test-generation.c index 4df5a0d..de87f2b 100644 --- a/test-generation.c +++ b/test-generation.c @@ -102,4 +102,5 @@ int main(int ac, const char **av) show_commit(commit, gd); } + return 0; } -- 1.7.12 -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/3] rebase -i: Teach --edit-todo
The flag will allow the user to edit the todo file while they're in the middle of an interactive rebase. It simply invoke the editor and do nothing else. More discussions here: http://thread.gmane.org/gmane.comp.version-control.git/205133/focus=205182 Andrew Wong (3): rebase -i: Refactor help messages for todo file rebase -i: Teach --edit-todo action rebase -i: Add tests for --edit-todo Documentation/git-rebase.txt | 5 - git-rebase--interactive.sh| 47 +-- git-rebase.sh | 14 + t/t3404-rebase-interactive.sh | 16 +++ 4 files changed, 70 insertions(+), 12 deletions(-) -- 1.7.12.318.g08bf5ad.dirty -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 01/12] git p4 test: remove bash-ism of combined export/assignment
Looks good to me, ack. On 09/09/12 21:16, Pete Wyckoff wrote: Signed-off-by: Pete Wyckoffp...@padd.com --- t/lib-git-p4.sh | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/t/lib-git-p4.sh b/t/lib-git-p4.sh index 2d753ab..482eeac 100644 --- a/t/lib-git-p4.sh +++ b/t/lib-git-p4.sh @@ -26,9 +26,10 @@ testid=${this_test#t} git_p4_test_start=9800 P4DPORT=$((10669 + ($testid - $git_p4_test_start))) -export P4PORT=localhost:$P4DPORT -export P4CLIENT=client -export P4EDITOR=: +P4PORT=localhost:$P4DPORT +P4CLIENT=client +P4EDITOR=: +export P4PORT P4CLIENT P4EDITOR db=$TRASH_DIRECTORY/db cli=$(test-path-utils real_path $TRASH_DIRECTORY/cli) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?
Hi, On 15 September 2012 18:21, Junio C Hamano gits...@pobox.com wrote: David Chanters david.chant...@googlemail.com writes: 2. If I do publish it, are there any caveats with that? i.e., because the replace data will likely point to a repo which in my working checkout I added with git-remote, is that going to be a problem? That is between you and other project participants. They may not want to see replacement in their project in the first place. Assuming that they do, pushing the replacement ref makes the replacing object available in the pushed-into repository, so they will *not* rely on your repository. This makes sense. But it is more the mechanics of what happens with needing to update the fetch line for the remote in .git/config I am more puzzled by. For example, if I have two repos -- repoA and repoB, where repoA contains the replace refs for repoB -- if I clone both repos with the intent of wanting to look at the two histories, what must I do in repoA to fetch the replace refs in the first place? I've tried: [remote origin] fetch = +refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/* But this results in: % git pull fatal: Invalid refspec '+refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/*' So I'm clearly not understanding something here, and even then, I'm assuming that I can manipulate the correct fetch line via git config, it's just that I'm not sure which one to use. I keep meaning to read up on refspec stuff because it looks so useful. Kindly, David -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 03/12] git p4: remove submit failure options [a]pply and [w]rite
git-p4 won't be quite the same without these completely misleading and confusing messages :-) Ack. On 09/09/12 21:16, Pete Wyckoff wrote: When a patch failed to apply, these interactive options offered to: 1) apply the patch anyway, leaving reject (.rej) files around, or, 2) write the patch to a file (patch.txt) In both cases it suggested to invoke git p4 submit --continue, an unimplemented option. While manually fixing the rejects and submitting the result might work, there are many steps that must be done to the job properly: * apply patch * invoke p4 add and delete * change executable bits * p4 sync -f renamed/copied files * extract commit message into p4 change description and move Jobs lines out of description section * set changelist owner for --preserve-user Plus the following manual sync/rebase will cause conflicts too, which must be resolved once again. Drop these workflows. Instead users should do a sync/rebase in git, fix the conflicts there, and do a clean git p4 submit. Signed-off-by: Pete Wyckoffp...@padd.com --- git-p4.py | 20 ++-- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/git-p4.py b/git-p4.py index 2405f38..e08fea1 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1200,9 +1200,8 @@ class P4Submit(Command, P4UserMap): if not patch_succeeded: print What do you want to do? response = x -while response != s and response != a and response != w: -response = raw_input([s]kip this patch / [a]pply the patch forcibly - and with .rej files / [w]rite the patch to a file (patch.txt) ) +while response != s: +response = raw_input([s]kip this patch ) if response == s: print Skipping! Good luck with the next patches... for f in editedFiles: @@ -1210,21 +1209,6 @@ class P4Submit(Command, P4UserMap): for f in filesToAdd: os.remove(f) return False -elif response == a: -os.system(applyPatchCmd) -if len(filesToAdd) 0: -print You may also want to call p4 add on the following files: -print .join(filesToAdd) -if len(filesToDelete): -print The following files should be scheduled for deletion with p4 delete: -print .join(filesToDelete) -die(Please resolve and submit the conflict manually and -+ continue afterwards with git p4 submit --continue) -elif response == w: -system(diffcmd + patch.txt) -print Patch saved to patch.txt in %s ! % self.clientPath -die(Please resolve and submit the conflict manually and -continue afterwards with git p4 submit --continue) system(applyPatchCmd) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 04/12] git p4: move conflict prompt into run, add [q]uit input
I'll need to supply a followup patch to ensure that a config option can override the prompt. Ack. On 09/09/12 21:16, Pete Wyckoff wrote: When applying a commit to the p4 workspace fails, a prompt asks what to do next. This belongs up in run() instead of in applyCommit(), where run() can notice, for instance, that the prompt is unnecessary because this is the last commit. Offer two options about how to continue at conflict: [s]kip or [q]uit. Having an explicit quit option gives git p4 a chance to clean up, show the applied-commit summary, and do tag export. Signed-off-by: Pete Wyckoffp...@padd.com --- git-p4.py | 41 + t/t9815-git-p4-submit-fail.sh | 31 +++ 2 files changed, 56 insertions(+), 16 deletions(-) diff --git a/git-p4.py b/git-p4.py index e08fea1..479f1fc 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1198,17 +1198,11 @@ class P4Submit(Command, P4UserMap): patch_succeeded = True if not patch_succeeded: -print What do you want to do? -response = x -while response != s: -response = raw_input([s]kip this patch ) -if response == s: -print Skipping! Good luck with the next patches... -for f in editedFiles: -p4_revert(f) -for f in filesToAdd: -os.remove(f) -return False +for f in editedFiles: +p4_revert(f) +for f in filesToAdd: +os.remove(f) +return False system(applyPatchCmd) @@ -1475,11 +1469,34 @@ class P4Submit(Command, P4UserMap): if gitConfig(git-p4.detectCopiesHarder, --bool) == true: self.diffOpts += --find-copies-harder +# +# Apply the commits, one at a time. On failure, ask if should +# continue to try the rest of the patches, or quit. +# applied = [] -for commit in commits: +last = len(commits) - 1 +for i, commit in enumerate(commits): ok = self.applyCommit(commit) if ok: applied.append(commit) +else: +if i last: +quit = False +while True: +print What do you want to do? +response = raw_input([s]kip this commit but apply + the rest, or [q]uit? ) +if not response: +continue +if response[0] == s: +print Skipping this commit, but applying the rest +break +if response[0] == q: +print Quitting +quit = True +break +if quit: +break chdir(self.oldWorkingDirectory) diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh index 5c36714..397b3e8 100755 --- a/t/t9815-git-p4-submit-fail.sh +++ b/t/t9815-git-p4-submit-fail.sh @@ -18,7 +18,7 @@ test_expect_success 'init depot' ' ) ' -test_expect_success 'conflict on one commit, skip' ' +test_expect_success 'conflict on one commit' ' test_when_finished cleanup_git git p4 clone --dest=$git //depot ( @@ -34,12 +34,12 @@ test_expect_success 'conflict on one commit, skip' ' echo line3file1 git add file1 git commit -m line3 in file1 will conflict - echo s | test_expect_code 1 git p4 submitout + test_expect_code 1 git p4 submitout test_i18ngrep No commits applied out ) ' -test_expect_success 'conflict on second of two commits, skip' ' +test_expect_success 'conflict on second of two commits' ' test_when_finished cleanup_git git p4 clone --dest=$git //depot ( @@ -57,7 +57,7 @@ test_expect_success 'conflict on second of two commits, skip' ' echo line4file1 git add file1 git commit -m line4 in file1 will conflict - echo s | test_expect_code 1 git p4 submitout + test_expect_code 1 git p4 submitout test_i18ngrep Applied only the commits out ) ' @@ -85,6 +85,29 @@ test_expect_success 'conflict on first of two commits, skip' ' ) ' +test_expect_success 'conflict on first of two commits, quit' ' + test_when_finished cleanup_git + git p4 clone --dest=$git //depot + ( + cd $cli + p4 open file1 + echo line7file1 + p4 submit -d line7 in file1 + ) + ( + cd $git + git config git-p4.skipSubmitEdit true + #
Re: [PATCHv2 05/12] git p4: standardize submit cancel due to unchanged template
Ack. On 09/09/12 21:16, Pete Wyckoff wrote: When editing the submit template, if no change was made to it, git p4 offers a prompt Submit anyway?. Answering no cancels the submit. Previously, a no answer behaves like a [s]kip answer to the failed-patch prompt, in that it proceeded to try to apply the rest of the commits. Instead, put users back into the new [s]kip / [c]ontinue loop so that they can decide. This makes both cases of patch failure behave identically. The return code of git p4 after a no answer is now the same as that for a skip due to failed patch; update a test to understand this. Signed-off-by: Pete Wyckoffp...@padd.com --- git-p4.py | 4 +++- t/t9805-git-p4-skip-submit-edit.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/git-p4.py b/git-p4.py index 479f1fc..39fa2e1 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1262,6 +1262,7 @@ class P4Submit(Command, P4UserMap): if self.edit_template(fileName): # read the edited message and submit +ret = True tmpFile = open(fileName, rb) message = tmpFile.read() tmpFile.close() @@ -1285,6 +1286,7 @@ class P4Submit(Command, P4UserMap): else: # skip this patch +ret = False print Submission cancelled, undoing p4 changes. for f in editedFiles: p4_revert(f) @@ -1293,7 +1295,7 @@ class P4Submit(Command, P4UserMap): os.remove(f) os.remove(fileName) -return True # success +return ret # Export git tags as p4 labels. Create a p4 label and then tag # with that. diff --git a/t/t9805-git-p4-skip-submit-edit.sh b/t/t9805-git-p4-skip-submit-edit.sh index fb3c8ec..ff2cc79 100755 --- a/t/t9805-git-p4-skip-submit-edit.sh +++ b/t/t9805-git-p4-skip-submit-edit.sh @@ -38,7 +38,7 @@ test_expect_success 'no config, unedited, say no' ' cd $git echo linefile1 git commit -a -m change 3 (not really) - printf bad response\nn\n | git p4 submit + printf bad response\nn\n | test_expect_code 1 git p4 submit p4 changes //depot/...wc test_line_count = 2 wc ) -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Using git-replace in place of grafts -- and publishing .git/refs/replace between repos?
Hi, On Sat, Sep 15, 2012 at 11:49 PM, David Chanters david.chant...@googlemail.com wrote: Hi, On 15 September 2012 18:21, Junio C Hamano gits...@pobox.com wrote: Assuming that they do, pushing the replacement ref makes the replacing object available in the pushed-into repository, so they will *not* rely on your repository. This makes sense. But it is more the mechanics of what happens with needing to update the fetch line for the remote in .git/config I am more puzzled by. For example, if I have two repos -- repoA and repoB, where repoA contains the replace refs for repoB -- if I clone both repos with the intent of wanting to look at the two histories, what must I do in repoA to fetch the replace refs in the first place? I've tried: [remote origin] fetch = +refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/* Could you try the following: [remote origin] fetch = +refs/replace/*:refs/replace/* fetch = +refs/heads/*:refs/remotes/origin/* But this results in: % git pull fatal: Invalid refspec '+refs/replace/*:+refs/heads/*:refs/remotes/origin/*:refs/replace/*' Best, Christian. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Unable to clone GIT project
I have created a GIT repository on Linux 64 bit machine. When I tried to clone GIT repository on windows 7 machine then I am getting below error. Error: git-upload-pack: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory fatal: The remote end hung up unexpectedly anyone please help me resolve the issue. Regards, Ankush -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Add userdiff patterns for Ada
Add Ada xfuncname and wordRegex patterns to the list of builtin patterns. Signed-off-by: Adrian Johnson ajohn...@redneon.com --- Documentation/gitattributes.txt | 2 ++ t/t4018-diff-funcname.sh| 2 +- t/t4034-diff-words.sh | 1 + t/t4034/ada/expect | 27 +++ t/t4034/ada/post| 13 + t/t4034/ada/pre | 13 + userdiff.c | 9 + 7 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 t/t4034/ada/expect create mode 100644 t/t4034/ada/post create mode 100644 t/t4034/ada/pre diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 462b79c..99ed04d 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -511,6 +511,8 @@ configuration file (you still need to enable this with the attribute mechanism, via `.gitattributes`). The following built in patterns are available: +- `ada` suitable for source code in the Ada language. + - `bibtex` suitable for files with BibTeX coded references. - `cpp` suitable for source code in the C and C++ languages. diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh index 4bd2a1c..082d3e8 100755 --- a/t/t4018-diff-funcname.sh +++ b/t/t4018-diff-funcname.sh @@ -105,7 +105,7 @@ test_expect_funcname () { grep ^@@.*@@ $1 diff } -for p in bibtex cpp csharp fortran html java matlab objc pascal perl php python ruby tex +for p in ada bibtex cpp csharp fortran html java matlab objc pascal perl php python ruby tex do test_expect_success builtin $p pattern compiles ' echo *.java diff=$p .gitattributes diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh index 30d42cb..40ab333 100755 --- a/t/t4034-diff-words.sh +++ b/t/t4034-diff-words.sh @@ -298,6 +298,7 @@ test_expect_success 'unset default driver' ' test_unconfig diff.wordregex ' +test_language_driver ada test_language_driver bibtex test_language_driver cpp test_language_driver csharp diff --git a/t/t4034/ada/expect b/t/t4034/ada/expect new file mode 100644 index 000..be2376e --- /dev/null +++ b/t/t4034/ada/expect @@ -0,0 +1,27 @@ +BOLDdiff --git a/pre b/postRESET +BOLDindex d96fdd1..df21bb0 100644RESET +BOLD--- a/preRESET +BOLD+++ b/postRESET +CYAN@@ -1,13 +1,13 @@RESET +Ada.Text_IO.Put_Line(Hello WorldRED!RESETGREEN?RESET); +1 1eRED-RESET10 16#FE12#E2 3.141_592 'REDxRESETGREENyRESET' +REDaRESETGREENxRESET+REDb aRESETGREENy xRESET-REDbRESET +REDaRESETGREENyRESET +GREENxRESET*REDb aRESETGREENy xRESET/REDbRESET +REDaRESETGREENyRESET +GREENxRESET**REDbRESET +REDaRESETGREENyRESET +GREENxRESET(REDbRESETGREENyRESET) +REDaRESETGREENxRESET:=REDbRESET +REDaRESETGREENyRESET +GREENxRESET=REDb aRESETGREENy xRESET/= REDbRESET +REDaRESETGREENyRESET +GREENxRESETREDb aRESETGREENy xRESET=REDb aRESETGREENy xRESETREDb aRESETGREENy xRESET=REDbRESET +REDaRESETGREENyRESET +GREENxRESET,REDbRESET +REDaRESETGREENyRESET +GREENxRESET=REDbRESET +REDaRESETGREENyRESET +GREENxRESET..REDbRESET +REDaRESETGREENyRESET +GREENxRESETREDbRESETGREENyRESET diff --git a/t/t4034/ada/post b/t/t4034/ada/post new file mode 100644 index 000..df21bb0 --- /dev/null +++ b/t/t4034/ada/post @@ -0,0 +1,13 @@ +Ada.Text_IO.Put_Line(Hello World?); +1 1e10 16#FE12#E2 3.141_592 'y' +x+y x-y +x*y x/y +x**y +x(y) +x:=y +x=y x/= y +xy x=y xy x=y +x,y +x=y +x..y +xy diff --git a/t/t4034/ada/pre b/t/t4034/ada/pre new file mode 100644 index 000..d96fdd1 --- /dev/null +++ b/t/t4034/ada/pre @@ -0,0 +1,13 @@ +Ada.Text_IO.Put_Line(Hello World!); +1 1e-10 16#FE12#E2 3.141_592 'x' +a+b a-b +a*b a/b +a**b +a(b) +a:=b +a=b a/= b +ab a=b ab a=b +a,b +a=b +a..b +ab diff --git a/userdiff.c b/userdiff.c index 1e7184f..ed958ef 100644 --- a/userdiff.c +++ b/userdiff.c @@ -14,6 +14,15 @@ static int drivers_alloc; { name, NULL, -1, { pattern, REG_EXTENDED | REG_ICASE }, \ word_regex |[^[:space:]]|[\xc0-\xff][\x80-\xbf]+ } static struct userdiff_driver builtin_drivers[] = { +IPATTERN(ada, +!^(.*[ \t])?(is new|renames|is separate)([ \t].*)?$\n +!^[ \t]*with[ \t].*$\n +^[ \t]*((procedure|function)[ \t]+.*)$\n +^[ \t]*((package|protected|task)[ \t]+.*)$, +/* -- */ +[a-zA-Z][a-zA-Z0-9_]* +|[0-9][-+0-9#_.eE] +|=|\\.\\.|\\*\\*|:=|/=|=|=|||), IPATTERN(fortran, !^([C*]|[ \t]*!)\n !^[ \t]*MODULE[ \t]+PROCEDURE[ \t]\n -- 1.7.12.465.g52d9ccc -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html