Git development
 help / color / mirror / Atom feed
* Re: Finding all commits which modify a file
From: Junio C Hamano @ 2012-02-02 19:13 UTC (permalink / raw)
  To: Neal Groothuis; +Cc: git
In-Reply-To: <5456.38.96.167.131.1328194547.squirrel@mail.lo-cal.org>

"Neal Groothuis" <ngroot@lo-cal.org> writes:

>> "Neal Groothuis" <ngroot@lo-cal.org> writes:
>>
>>> Is there a situation where checking for TREESAMEness before
>>> simplification
>>> is desirable and checking after would not be?
>>
>> When you do not want to see a side branch that does not contribute to
> the end result at all, obviously ;-). Outside that situation, before or
> after should not make a difference, I would think.
>
> In that case, you wouldn't be using the --full-history flag at all, yeah?

Yes. In case my tongue-in-cheek comment was too obscure, I was saying that
I do not think the change to TREESAME-ness check you were alluding to would
break any use case I would think of off the top of my head.

We of course might discover undesired consequences in unexpected corners
after we try your change, but I do not think we can discuss such corner
cases further without seeing a patch.

^ permalink raw reply

* Re: how to tell when git release changes porcelain stdout/stderr
From: Jonathan Nieder @ 2012-02-02 19:11 UTC (permalink / raw)
  To: Neal Kreitzinger; +Cc: git
In-Reply-To: <jgeert$qeg$1@dough.gmane.org>

Hi Neal,

Neal Kreitzinger wrote:

> What is the best way for me (a git user) to tell when a new git release 
> changes the stdout/stderr formatting of a porcelain command?

They almost always do.  Maybe that will be happening less often as
messages get translated, but if you really need reproducible output,
your life will be much easier if you just use plumbing instead (and
please report problems when they arise).

^ permalink raw reply

* [PATCH, RFC] Fix build problems related to profile-directed optimization
From: Theodore Ts'o @ 2012-02-02 19:03 UTC (permalink / raw)
  To: git; +Cc: Theodore Ts'o, Andi Kleen

There was a number of problems I ran into when trying the
profile-directed optimizations added by Andi Kleen in git commit
7ddc2710b9.  (This was using gcc 4.4 found on many enterprise
distros.)

1) The -fprofile-generate and -fprofile-use commands are incompatible
with ccache; the code ends up looking in the wrong place for the gcda
files based on the ccache object names.

2) If the makefile notices that CFLAGS are different, it will rebuild
all of the binaries.  Hence the recipe originally specified by the
INSTALL file ("make profile-all" followed by "make install") doesn't
work.  It will appear to work, but the binaries will end up getting
built with no optimization.

This patch fixes this by using an explicit set of options passed via
PROFILE_GEN and PROFILE_USE and then using these to directly
manipulate CFLAGS and EXTLIBS.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andi Kleen <ak@linux.intel.com>
---
 INSTALL  |    4 ++--
 Makefile |   31 +++++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/INSTALL b/INSTALL
index 6fa83fe..978ed09 100644
--- a/INSTALL
+++ b/INSTALL
@@ -28,8 +28,8 @@ set up install paths (via config.mak.autogen), so you can write instead
 If you're willing to trade off (much) longer build time for a later
 faster git you can also do a profile feedback build with
 
-	$ make profile-all
-	# make prefix=... install
+	$ make prefix=... profile-all
+	# make prefix=... PROFILE_USE=t install
 
 This will run the complete test suite as training workload and then
 rebuild git with the generated profile feedback. This results in a git
diff --git a/Makefile b/Makefile
index c457c34..15d1df4 100644
--- a/Makefile
+++ b/Makefile
@@ -1772,6 +1772,24 @@ ifdef ASCIIDOC7
 	export ASCIIDOC7
 endif
 
+### profile feedback build
+#
+
+# Can adjust this to be a global directory if you want to do extended
+# data gathering
+PROFILE_DIR := $(CURDIR)
+
+ifdef PROFILE_GEN
+	CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
+	EXTLIBS += -lgcov
+	export CCACHE_DISABLE=t
+endif
+
+ifdef PROFILE_USE
+	CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
+	export CCACHE_DISABLE=t
+endif
+
 # Shell quote (do not use $(call) to accommodate ancient setups);
 
 SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
@@ -2701,14 +2719,11 @@ cover_db_html: cover_db
 #
 .PHONY: profile-all profile-clean
 
-PROFILE_GEN_CFLAGS := $(CFLAGS) -fprofile-generate -DNO_NORETURN=1
-PROFILE_USE_CFLAGS := $(CFLAGS) -fprofile-use -fprofile-correction -DNO_NORETURN=1
-
 profile-clean:
-	$(RM) $(addsuffix *.gcda,$(object_dirs))
-	$(RM) $(addsuffix *.gcno,$(object_dirs))
+	$(RM) $(addsuffix *.gcda,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
+	$(RM) $(addsuffix *.gcno,$(addprefix $(PROFILE_DIR)/, $(object_dirs)))
 
 profile-all: profile-clean
-	$(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" all
-	$(MAKE) CFLAGS="$(PROFILE_GEN_CFLAGS)" -j1 test
-	$(MAKE) CFLAGS="$(PROFILE_USE_CFLAGS)" all
+	$(MAKE) PROFILE_GEN=t all
+	$(MAKE) PROFILE_GEN=t -j1 test
+	$(MAKE) PROFILE_USE=t all
-- 
1.7.8.11.gefc1f.dirty

^ permalink raw reply related

* Re: git-svn branches with revision id's in name
From: Jehan Bing @ 2012-02-02 19:03 UTC (permalink / raw)
  To: git; +Cc: Stephen Duncan Jr
In-Reply-To: <4F2A807B.9050206@T-Online.de>

On 2012-02-02 04:24, Carsten Fuchs wrote:
> Hi all,
>
> Am 2012-01-30 20:42, schrieb Stephen Duncan Jr:
>> [...]
>> $ git branch -a
>> * master
>> remotes/develop
>> remotes/develop@29271
>> remotes/develop@32463
>> remotes/develop@34103
>> remotes/feature/xyz
>> remotes/feature/xyz@26438
>> remotes/feature/xyz@27542
>> remotes/feature/xyz@35233
>>
>> Why have these remote branches been created? What impact does this
>> have on my checkout? Can I remove safely remove them? How? I was
>> unable to figure out how to reference this behavior in order to search
>> for information on it.
>
> Same questions here.
> (I know how to remove them, but I'd love to learn and understand why
> they have been created.)

Those are branches that have been deleted and then recreated later.
In svn, you can always get a deleted branch back by checking out an old 
revision. But in git, branches are not part of the history, so when you 
delete a branch, it's completely gone, as if it never existed, taking 
with it any commit that has not been merged elsewhere.
To prevent that loss, git-svn doesn't delete branches. But if the branch 
was re-created later in svn, you would get a conflict in git. So 
instead, git-svn rename the old branch by adding the revision number 
where the branch last existed, i.e. the revision before it was deleted.

So in the OP case, the branch "develop" was deleted at least 3 times, at 
r34104, r32464 and r29272. The last one may also have been deleted too 
but then it was not re-created so git-svn didn't rename yet.

^ permalink raw reply

* Re: [msysGit] Breakage in master?
From: Johannes Schindelin @ 2012-02-02 18:57 UTC (permalink / raw)
  To: Erik Faye-Lund
  Cc: Git Mailing List, msysGit, Ævar Arnfjörð Bjarmason
In-Reply-To: <CABPQNSbWu0r_gKGvCHk567pUtQiyDOCO8vFfrzPMFW1eUaj1nw@mail.gmail.com>

Hi Erik,

On Thu, 2 Feb 2012, Erik Faye-Lund wrote:

> Something strange is going on in Junio's current 'master' branch
> (f3fb075). "git show" has started to error out on Windows with a
> complaint about our vsnprintf:
> ---8<---
> 
> $ git show
> commit f3fb07509c2e0b21b12a598fcd0a19a92fc38a9d
> Author: Junio C Hamano <gitster@pobox.com>
> Date:   Tue Jan 31 22:31:35 2012 -0800
> 
>     Update draft release notes to 1.7.10
> 
>     Signed-off-by: Junio C Hamano <gitster@pobox.com>
> 
> fatal: BUG: your vsnprintf is broken (returned -1)
> ---8<---
>
> [...]
>
> I'm at a loss here. Does anyone have a hunch about what's going on?

It very much reminds me of 6ef404095bc1162031fc3cb43430b512e975bc6a...

Is it possible that NO_GETTEXT is either not set, or ignored?

Ciao,
Dscho

^ permalink raw reply

* Re: [PATCH 1/3] vcs-svn: rename check_overflow arguments for clarity
From: Junio C Hamano @ 2012-02-02 18:56 UTC (permalink / raw)
  To: Jonathan Nieder
  Cc: David Barr, Dmitry Ivankov, Junio C Hamano, Ramsay Jones,
	GIT Mailing-list
In-Reply-To: <20120202112732.GA15537@burratino>

Ok, I've tentatively queued this.

-- >8 --
From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>

Code using the argument names a and b just doesn't look right (not
sure why!).  Use more explicit names "offset" and "len" to make their
type and meaning clearer.

Also rename check_overflow() to check_offset_overflow() to clarify
that we are making sure that "len" bytes beyond "offset" still fits
the type to represent an offset.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 vcs-svn/sliding_window.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vcs-svn/sliding_window.c b/vcs-svn/sliding_window.c
index 1bac7a4..c6c2eff 100644
--- a/vcs-svn/sliding_window.c
+++ b/vcs-svn/sliding_window.c
@@ -31,15 +31,15 @@ static int read_to_fill_or_whine(struct line_buffer *file,
 	return 0;
 }
 
-static int check_overflow(off_t a, size_t b)
+static int check_offset_overflow(off_t offset, size_t len)
 {
-	if (b > maximum_signed_value_of_type(off_t))
+	if (len > maximum_signed_value_of_type(off_t))
 		return error("unrepresentable length in delta: "
-				"%"PRIuMAX" > OFF_MAX", (uintmax_t) b);
-	if (signed_add_overflows(a, (off_t) b))
+				"%"PRIuMAX" > OFF_MAX", (uintmax_t) len);
+	if (signed_add_overflows(offset, (off_t) len))
 		return error("unrepresentable offset in delta: "
 				"%"PRIuMAX" + %"PRIuMAX" > OFF_MAX",
-				(uintmax_t) a, (uintmax_t) b);
+				(uintmax_t) offset, (uintmax_t) len);
 	return 0;
 }
 
@@ -48,9 +48,9 @@ int move_window(struct sliding_view *view, off_t off, size_t width)
 	off_t file_offset;
 	assert(view);
 	assert(view->width <= view->buf.len);
-	assert(!check_overflow(view->off, view->buf.len));
+	assert(!check_offset_overflow(view->off, view->buf.len));
 
-	if (check_overflow(off, width))
+	if (check_offset_overflow(off, width))
 		return -1;
 	if (off < view->off || off + width < view->off + view->width)
 		return error("invalid delta: window slides left");
-- 
1.7.9.172.ge26ae

^ permalink raw reply related

* Re: [PATCH] vcs-svn: Fix some compiler warnings
From: Jonathan Nieder @ 2012-02-02 18:53 UTC (permalink / raw)
  To: Ramsay Jones; +Cc: David Barr, Junio C Hamano, GIT Mailing-list, Dmitry Ivankov
In-Reply-To: <4F2AD4CF.7020303@ramsay1.demon.co.uk>

Ramsay Jones wrote:

> An static inline function was actually my first thought (although I had
> something more like Junio's suggestion [elsewhere in this thread] in mind),
> but I didn't want to place it in git-compat-util.h and could not find a
> suitable place in the vcs-svn directory.
>
> Hmm, I will send a v2 patch along these lines ...

Well, your v2 patch looks good to me.  The three-patch series I
sent[1] also look good to me.  I guess I could queue your v2 and put
the rest on top --- what say you?

[1] http://thread.gmane.org/gmane.comp.version-control.git/189618
http://repo.or.cz/w/git/jrn.git/log/refs/topics/rj/svn-fe-type-limits

^ permalink raw reply

* Re: [PATCH] i18n: po for zh_cn
From: Junio C Hamano @ 2012-02-02 18:49 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy
  Cc: Jiang Xin, Git List, Ævar Arnfjörð Bjarmason
In-Reply-To: <CACsJy8BPTuS+u8Grx0ojhdX-5+Vn6=DuojSWO0or7fJE1dbAEQ@mail.gmail.com>

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> On Thu, Feb 2, 2012 at 6:45 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Jiang Xin <worldhello.net@gmail.com> writes:
>>
>>> Git can speak Chinese now.
>>>
>>> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
>>> ---
>>>  po/zh_cn.po | 3568 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 个文件被修改, 3568 处添加(+), 0 处删除(-)
>>>  create mode 100644 po/zh_cn.po
>>
>> I do not mind Chinese in the patch text (i.e. below), but I would have
>> preferred the above not to be in Chinese, which I do not read---I can
>> guess what 文件, 添加 and 删除 are, and I can also guess that 个 and 处
>> are units of counting, but nevertheless...
>
> Such a stat line would be wonderful in an all-Chinese environment
> though.

Yes, but the git mailing list is not all-Chinese environment. I was merely
asking that the future submissions will be prepared with something like a
one-shot "LC_ALL=C git format-patch ..."; it wasn't a suggestion not to i18n
the summary bit.

^ permalink raw reply

* Re: [PATCH 0/9] respect binary attribute in grep
From: Junio C Hamano @ 2012-02-02 18:39 UTC (permalink / raw)
  To: Jeff King
  Cc: Thomas Rast, Conrad Irwin, git, Nguyen Thai Ngoc Duy,
	Dov Grobgeld
In-Reply-To: <20120202081747.GA10271@sigill.intra.peff.net>

Jeff King <peff@peff.net> writes:

> ... The result turned out much easier to read
> (and explain in the commit messages, as it was simple to break into
> smaller commits)....

Indeed the series is very nicely done ;-)

Thanks.

^ permalink raw reply

* [PATCH v2] vcs-svn: Fix some compiler warnings
From: Ramsay Jones @ 2012-02-02 18:36 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, GIT Mailing-list


In particular, some versions of gcc complains as follows:

        CC vcs-svn/sliding_window.o
    vcs-svn/sliding_window.c: In function `check_overflow':
    vcs-svn/sliding_window.c:36: warning: comparison is always false \
        due to limited range of data type

        CC vcs-svn/fast_export.o
    vcs-svn/fast_export.c: In function `fast_export_blob_delta':
    vcs-svn/fast_export.c:303: warning: comparison is always false due \
        to limited range of data type

Simply casting the (limited range unsigned) variable in the comparison
to an uintmax_t does not suppress the warning, however, since gcc is
"smart" enough to know that the cast does not change anything regarding
the value of the casted expression. In order to suppress the warning, we
introduce a static inline function to hide the (implicit) cast of the
original variable to an uintmax_t type prior to using it in the overflow
check comparison expression.

Note that the "some versions of gcc" which complain includes 3.4.4 and
4.1.2, whereas gcc version 4.4.0 compiles the code without complaint.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

Hi Jonathan,

Any suggestions for a better name than "value_too_large_for_off_t" will
be greatly accepted! :)

Also, I suppose you could make a similar change to the other two sites
in vcs-svn with similar range checks (fast_export.c:174 and svndiff.c:150).

ATB,
Ramsay Jones

 git-compat-util.h        |    5 +++++
 vcs-svn/fast_export.c    |    2 +-
 vcs-svn/sliding_window.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/git-compat-util.h b/git-compat-util.h
index 8f3972c..6a6a25a 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -450,6 +450,11 @@ static inline size_t xsize_t(off_t len)
 	return (size_t)len;
 }
 
+static inline int value_too_large_for_off_t(uintmax_t val)
+{
+	return val > maximum_signed_value_of_type(off_t);
+}
+
 static inline int has_extension(const char *filename, const char *ext)
 {
 	size_t len = strlen(filename);
diff --git a/vcs-svn/fast_export.c b/vcs-svn/fast_export.c
index 19d7c34..2e0dcb0 100644
--- a/vcs-svn/fast_export.c
+++ b/vcs-svn/fast_export.c
@@ -300,7 +300,7 @@ void fast_export_blob_delta(uint32_t mode,
 				uint32_t len, struct line_buffer *input)
 {
 	long postimage_len;
-	if (len > maximum_signed_value_of_type(off_t))
+	if (value_too_large_for_off_t(len))
 		die("enormous delta");
 	postimage_len = apply_delta((off_t) len, input, old_data, old_mode);
 	if (mode == REPO_MODE_LNK) {
diff --git a/vcs-svn/sliding_window.c b/vcs-svn/sliding_window.c
index 1bac7a4..0d38482 100644
--- a/vcs-svn/sliding_window.c
+++ b/vcs-svn/sliding_window.c
@@ -33,7 +33,7 @@ static int read_to_fill_or_whine(struct line_buffer *file,
 
 static int check_overflow(off_t a, size_t b)
 {
-	if (b > maximum_signed_value_of_type(off_t))
+	if (value_too_large_for_off_t(b))
 		return error("unrepresentable length in delta: "
 				"%"PRIuMAX" > OFF_MAX", (uintmax_t) b);
 	if (signed_add_overflows(a, (off_t) b))
-- 
1.7.9

^ permalink raw reply related

* Re: [PATCH] Fix an "variable might be used uninitialized" gcc warning
From: Ramsay Jones @ 2012-02-02 18:25 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Junio C Hamano, GIT Mailing-list
In-Reply-To: <20120131194302.GD12443@burratino>

Jonathan Nieder wrote:
> Sure, when the control flow grows too complicated, that's probably worth
> fixing anyway, for the sake of humans especially.
> 
> Sometimes gcc is the only crazy one, though. ;-)

Indeed. :-D

ATB,
Ramsay Jones

^ permalink raw reply

* Re: [PATCH] vcs-svn: Fix some compiler warnings
From: Ramsay Jones @ 2012-02-02 18:24 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: David Barr, Junio C Hamano, GIT Mailing-list
In-Reply-To: <20120131192053.GC12443@burratino>

Jonathan Nieder wrote:
> Ramsay Jones wrote:
> 
>> In particular, some versions of gcc complains as follows:
>>
>>         CC vcs-svn/sliding_window.o
>>     vcs-svn/sliding_window.c: In function `check_overflow':
>>     vcs-svn/sliding_window.c:36: warning: comparison is always false \
>>         due to limited range of data type
> 
> Yuck.  Suppressing this warning would presumably also suppress the
> optimization that notices the comparison is always false.

I didn't check, but I would assume so.  I would prefer not to loose any
chance at optimizing the code, but in this case, given that we are talking
about a fatal error path, I don't think it is much of a loss.

> The -Wtype-limits warning also triggers in some other perfectly
> reasonable situations: see <http://gcc.gnu.org/PR51712>.
[...]
>> Note that the "some versions of gcc" which complain includes 3.4.4 and
>> 4.1.2, whereas gcc version 4.4.0 compiles the code without complaint.
> 
> Thanks for tracking this down.  Interesting.  -Wtype-limits was split
> out from the default set of warnings (!) in gcc 4.3 to address
> <http://gcc.gnu.org/PR12963>, among other bugs (r124875, 2007-05-20).

Thanks for the above references, and for taking the time to track them
down.

> Is there some less ugly way to write the condition "if this value is
> not representable in this type"?
> 
> I guess I could live with something like the following (please don't
> take the names too seriously):
> 
> 	static inline off_t off_t_or_die(uintmax_t val, const char *msg_if_bad)
> 	{
> 		if (val > maximum_signed_value_of_type(off_t))
> 			die("%s", msg_if_bad);
> 		return (off_t) val;
> 	}
> 
> 	...
> 
> 		off_t delta_len = off_t_or_die(len, "enormous delta");
> 		postimage_len = apply_delta(delta_len, input, ...);
> 
> What do you think?

An static inline function was actually my first thought (although I had
something more like Junio's suggestion [elsewhere in this thread] in mind),
but I didn't want to place it in git-compat-util.h and could not find a
suitable place in the vcs-svn directory.

Hmm, I will send a v2 patch along these lines ...

ATB,
Ramsay Jones

^ permalink raw reply

* Re: How best to handle multiple-authorship commits in GIT?
From: David Howells @ 2012-02-02 18:36 UTC (permalink / raw)
  To: Valerie Aurora; +Cc: dhowells, git@vger.kernel.org
In-Reply-To: <9B990DDC-858D-43BA-BF9E-E0C3435354AF@gmail.com>

Valerie Aurora <valerie.aurora@gmail.com> wrote:

> There is a line in the kernel doc saying how this should be handled,
> suggested by Rusty, but it's not being followed.

Do you know where?

David

^ permalink raw reply

* Re: [PATCH 6/9] grep: cache userdiff_driver in grep_source
From: Junio C Hamano @ 2012-02-02 18:34 UTC (permalink / raw)
  To: Jeff King
  Cc: Thomas Rast, Conrad Irwin, git, Nguyen Thai Ngoc Duy,
	Dov Grobgeld
In-Reply-To: <20120202082043.GF6786@sigill.intra.peff.net>

Jeff King <peff@peff.net> writes:

> -		grep_attr_lock();
> -		drv = userdiff_find_by_path(gs->name);
> -		grep_attr_unlock();
> -		if (drv && drv->funcname.pattern) {
> -			const struct userdiff_funcname *pe = &drv->funcname;
> +		grep_source_load_driver(gs);
> +		if (gs->driver->funcname.pattern) {
> +			const struct userdiff_funcname *pe = &gs->driver->funcname;

When we load driver, gs->driver gets at least "default" driver, so we no
longer need to check for drv != NULL as we used to?  Is that the reason
for the slight difference here?

> @@ -1237,6 +1234,7 @@ void grep_source_init(struct grep_source *gs, enum grep_source_type type,
>  	gs->name = name ? xstrdup(name) : NULL;
>  	gs->buf = NULL;
>  	gs->size = 0;
> +	gs->driver = NULL;
>  
>  	switch (type) {
>  	case GREP_SOURCE_FILE:

^ permalink raw reply

* Re: [PATCH v2] Use correct grammar in diffstat summary line
From: Junio C Hamano @ 2012-02-02 18:24 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy
  Cc: git, Jonathan Nieder, Ævar Arnfjörð,
	Frederik Schwarzer, Brandon Casey
In-Reply-To: <20120202142255.GA25871@do>

Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:

> On Wed, Feb 01, 2012 at 01:26:43PM -0800, Junio C Hamano wrote:
>> Nice.  Will queue
>
> Please also squash this in (resend looks ugly and it's hard to point
> out changes). It makes the code look less ugly, use Q_() for gettext
> poisoning and revert am input text back as Jonathan suggested.
>
> I take it --summary is un-i18n-able,...

... because?

^ permalink raw reply

* Re: How best to handle multiple-authorship commits in GIT?
From: Valerie Aurora @ 2012-02-02 18:00 UTC (permalink / raw)
  To: David Howells; +Cc: git@vger.kernel.org, dhowells@redhat.com
In-Reply-To: <21056.1328185509@redhat.com>

On Feb 2, 2012, at 4:25, David Howells <dhowells@redhat.com> wrote:

> 
> Hi,
> 
> I've been assigned a stack of patches to maintain and try and get upstream by
> my employer.  Most of the patches currently have the authorship set to Val,
> but since I'll be maintaining them if they go in upstream and I've changed
> them a lot, I feel I should reassign the author field to myself so people
> pester me rather than Val with questions about them.  However, I don't want to
> deny Val or any other contributor credit for their work on the patches.
> 
> I can see a number of ways of doing this, and am wondering which will be best:
> 
> (1) Ascribe multiple authorship directly in the commit.  I suspect this would
>     require a change to GIT and its associated tools.  That way I could put my
>     name in the priority pestering spot, but doing a search on authorship
>     would still credit Val and others.
> 
> (2) Add an extra tag 'Originally-authored-by' (or maybe 'Coauthored-by' as I
>     saw someone recommend) in amongst the 'Signed-off-by' list.  But that
>     doesn't give them credit in a gitweb search without changing gitweb.
> 
> (3) Don't actually modify Val's commits to bring them up to date, but rather
>     create a historical GIT tree with Val's commits committed as-are and then
>     add my changes to the top in a number of large merge commits (there have
>     been multiple major breakages due to different merge windows).
> 
>     I dislike this approach because it doesn't produce a nice set of patches I
>     can give to someone to review (which is a must).  Plus, for the most part,
>     it's actually easier to port Val's patches individually.
> 
> Can GIT be modified to do (1)?  Gitweb's display need only show one of the
> authors in the single-row-per-patch list mode, but should find a patch by any
> of the authors in an author search and should display all the authors in the
> commit display.
> 
> David

Thanks, David!  I had the same trouble with my set: while I entirely rewrote some patches, I still felt Jan Blunck deserved primary credit.  I don't recall my solution, but I'm fine with mentioning my name in the commit message (and I think Jan should get credit too).

In general, this is a big problem for motivating contributors in other cases.  Some maintainers have a habit of trivially rewriting patches so that, technically, no line is the same, then taking authorship and giving the actual author an ambiguous Signed-off-by.  David hasn't done this here, of course - these are major rewrites - but when someone does all the hard work of finding and fixing a problem, the credit shouldn't go to the person who prettied it up.  There is a line in the kernel doc saying how this should be handled, suggested by Rusty, but it's not being followed.

First class support for multiple authorship would be a big way to motivate contributors.

-VAL

^ permalink raw reply

* Re: Breakage in master?
From: Jeff King @ 2012-02-02 17:46 UTC (permalink / raw)
  To: Erik Faye-Lund
  Cc: Git Mailing List, msysGit, Ævar Arnfjörð Bjarmason
In-Reply-To: <CABPQNSbWu0r_gKGvCHk567pUtQiyDOCO8vFfrzPMFW1eUaj1nw@mail.gmail.com>

On Thu, Feb 02, 2012 at 01:14:19PM +0100, Erik Faye-Lund wrote:

> But here's the REALLY puzzling part: If I add a simple, unused
> function to diff-lib.c, like this:
> [...]
> "git status" starts to error out with that same vsnprintf complaint!
> 
> ---8<---
> $ git status
> # On branch master
> # Changes not staged for commit:
> #   (use "git add <file>..." to update what will be committed)
> fatal: BUG: your vsnprintf is broken (returned -1)
> ---8<---

OK, that's definitely odd.

At the moment of the die() in strbuf_vaddf, what does errno say?
vsnprintf should generally never be returning -1 (it should return the
number of characters that would have been written). Since you're on
Windows, I assume you're using the replacement version in
compat/snprintf.c.

That one will return -1 if realloc fails. So I'm curious if that is what
is happening (you might also instrument the call to realloc in
snprintf.c to see if it is failing, and if so, at what maxsize). And/or
check errno in git_vsnprintf after calling the native vsnprintf and
getting -1.

Here's one possible sequence of events that seems plausible to me (and
remember that this is a wild guess):

  1. gettext somehow munges the format string in a way that Windows
     vsnprintf doesn't like, and it returns -1.

  2. Our git_vsnprintf wrapper interprets this -1 as "you didn't give me
     enough space to store the result", and we grow our test-buffer to
     try again

  3. Eventually the test buffer gets unreasonably large, and realloc
     fails. We have no choice but to return -1 from our wrapper.

  4. strbuf_vaddf sees the -1 and thinks you are using a broken
     vsnprintf.

All of that would make sense to me, _except_ for your weird "if I add a
random function, the problem is more reproducible" bit. Which does seem
like something is invoking undefined behavior (of course, it could be
that undefined behavior or stack-smashing that is causing vsnprintf to
report an error). Lacking any better leads, it might be worth pursuing.

> I've bisected the issues down to 5e9637c (i18n: add infrastructure for
> translating Git with gettext). Trying to apply my unused-function
> patch on top of this commit starts giving the same "fatal: BUG: your
> vsnprintf is broken (returned -1)" error. It's ancestor, bc1bbe0(Git
> 1.7.8-rc2), does not yield any of the issues.

I've looked at 5e9637c, and it really doesn't do anything that looks
bad. I wonder if your gettext library is buggy. Does compiling with
NO_GETTEXT help?

-Peff

^ permalink raw reply

* how to tell when git release changes porcelain stdout/stderr
From: Neal Kreitzinger @ 2012-02-02 16:50 UTC (permalink / raw)
  To: git

What is the best way for me (a git user) to tell when a new git release 
changes the stdout/stderr formatting of a porcelain command?

v/r,
neal 

^ permalink raw reply

* Re: I18N.pm is incompatible with perl < 5.8.3
From: Ævar Arnfjörð Bjarmason @ 2012-02-02 16:48 UTC (permalink / raw)
  To: Tom G. Christensen; +Cc: git
In-Reply-To: <4F2A8B78.6090902@statsbiblioteket.dk>

On Thu, Feb 2, 2012 at 14:11, Tom G. Christensen
<tgc@statsbiblioteket.dk> wrote:
> Hello,
>

Thanks Tom, I'll submit a patch for that. Does this work, i.e. does
5.8.3 need *{import} = instead of *import = ?

    diff --git a/perl/Git/I18N.pm b/perl/Git/I18N.pm
    index 07597dc..5bcfed5 100644
    --- a/perl/Git/I18N.pm
    +++ b/perl/Git/I18N.pm
    @@ -2,7 +2,16 @@ package Git::I18N;
     use 5.008;
     use strict;
     use warnings;
    -use Exporter 'import';
    +BEGIN {
    +       require Exporter;
    +       if ($] < 5.008003) {
    +               *import = \&Exporter::import;
    +       } else {
    +               # Exporter 5.57 supporting this invocation was released with
    +               # 5.8.3
    +               Exporter->import('import');
    +       }
    +}

     our @EXPORT = qw(__);
     our @EXPORT_OK = @EXPORT;

But actually it might be better to check $Exporter::VERSION

^ permalink raw reply

* how to determine oldest supported version of git
From: Neal Kreitzinger @ 2012-02-02 16:46 UTC (permalink / raw)
  To: git

What is the best way for me (a git user) to determine what is currently the 
oldest supported version of git (the oldest version still getting bugfixes)? 
IOW, when can I tell that my version of git is no longer supported?

v/r,
neal 

^ permalink raw reply

* Re: [PATCH] i18n: po for zh_cn
From: Ævar Arnfjörð Bjarmason @ 2012-02-02 16:42 UTC (permalink / raw)
  To: Nguyen Thai Ngoc Duy; +Cc: Junio C Hamano, Jiang Xin, Git List
In-Reply-To: <CACsJy8BPTuS+u8Grx0ojhdX-5+Vn6=DuojSWO0or7fJE1dbAEQ@mail.gmail.com>

On Thu, Feb 2, 2012 at 14:29, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On Thu, Feb 2, 2012 at 6:45 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Jiang Xin <worldhello.net@gmail.com> writes:
>>
>>> Git can speak Chinese now.
>>>
>>> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
>>> ---
>>>  po/zh_cn.po | 3568 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>>>  1 个文件被修改, 3568 处添加(+), 0 处删除(-)
>>>  create mode 100644 po/zh_cn.po
>>
>> I do not mind Chinese in the patch text (i.e. below), but I would have
>> preferred the above not to be in Chinese, which I do not read---I can
>> guess what 文件, 添加 and 删除 are, and I can also guess that 个 and 处
>> are units of counting, but nevertheless...
>
> Such a stat line would be wonderful in an all-Chinese environment
> though. I'm thinking perhaps it's a good idea to support
> core.officialLocale (or workingLanguage). Commands that produce stuff
> for outside like format-patch would prefer core.exchangeLanguage over
> $LANG. Commands in blurred zone can learn --official option to ignore
> $LANG.
>
> We can then have a shared config with core.officialLocale =
> en_US.UTF-8 somewhere in git.git. Developers of multi-nation companies
> would be pleased, I think.

For now we can also avoid this whole issue and just declare that
anything that's used for interchange or permanently stored
(git-format-patch output, reflogs, merge commit messages etc.) will be
in English.

^ permalink raw reply

* Re: rebase -i reword runs pre-commit hook with curious results
From: Neal Kreitzinger @ 2012-02-02 16:39 UTC (permalink / raw)
  To: Andrew Wong; +Cc: Neal Kreitzinger, git
In-Reply-To: <4F2A2286.3090808@sohovfx.com>

On 2/1/2012 11:43 PM, Andrew Wong wrote:
> On 12-02-01 4:50 PM, Neal Kreitzinger wrote:
>> I'm confused on why and/or how interactive rebase runs the pre-commit
>> hook
>> when doing the reword command for commit (a).
> When you do a "reword" in "rebase -i", it basically does a "cherry-pick"
> of that commit first, then it does a "commit --amend". And your
> pre-commit hook should've been run during the amend.
>> IOW, the pre-commit hook does not get the same results as if I were
>> doing a
>> commandline git-commit of a modified index.
> Does your pre-commit hook work when doing a "commit --amend"? I'm not
> sure if you can actually modify the author (or committer) date from
> inside a pre-commit hook.
(We have a comment on "line 1" in our source with $User:$ $Date:$ 
keywords that the pre-commit hooks expands to insert "whoami" and "date" 
values to effect a user-datestamp at commit time.  We do this to enforce 
conflicts on same-file edits.)  Now that I understand that the 
cherry-pick takes place first to effect the transfer of the tree content 
and then a subsequent git-commit --amend of "no changes" takes place to 
effect the reword opportunity, the behavior makes sense now.  (We use 
git-commit --amend to reword commit messages also.)  The pre-commit hook 
runs prior to commit message editor just like commandline git-commit 
--amend (and plain git-commit).

thanks!

v/r,
neal

^ permalink raw reply

* Re: rebase -i reword converts to pick on pre-commit non-zero exit
From: Neal Kreitzinger @ 2012-02-02 16:21 UTC (permalink / raw)
  To: Andrew Wong; +Cc: git
In-Reply-To: <4F2A0D4B.6000001@sohovfx.com>

On 2/1/2012 10:12 PM, Andrew Wong wrote:
> On 12-02-01 4:28 PM, Neal Kreitzinger wrote:
>> Instead of picking commit (a) when the pre-commit hook exits
>> non-zero on the reword command, shouldn't interactive rebase learn
>> to edit commit (a) and tell the user that because the pre-commit
>> hook exited non-zero they need to either remedy the pre-commit hook
>> violations and run git commit --amend or run git commit --amend
>> --no-verify to bypass the pre-commit hook?
>
> Yup, I've submitted a patch to address this issue a while ago. This
> new behavior should be in v.1.7.8.2 and later.

I now see that this 1.7.8.2 release note applies:

  * When a "reword" action in "git rebase -i" failed to run "commit 
--amend",
    we did not give the control back to the user to resolve the
situation, and
    instead kept the original commit log message.

thanks!

v/r,
neal

^ permalink raw reply

* Re: Workflow for git dev
From: Frans Klaver @ 2012-02-02 15:25 UTC (permalink / raw)
  To: Tom Michaud; +Cc: git
In-Reply-To: <CALDO3MKFdZ85w5uJEcZ6dkC7SNXxKi7BAb7r78ciFzmNdjo7eg@mail.gmail.com>

On Thu, Feb 2, 2012 at 3:59 PM, Tom Michaud <tom.michaud@gmail.com> wrote:

> Would someone kindly point me to a document that describes the
> workflow Junio et al use to develop git?

Two notable documents in git.git are Documentation/SubmittingPatches
and Documentation/CodingGuidelines.

Hope that helps.

Frans

^ permalink raw reply

* Re: Workflow for git dev
From: Thomas Rast @ 2012-02-02 15:16 UTC (permalink / raw)
  To: Tom Michaud; +Cc: git
In-Reply-To: <CALDO3MKFdZ85w5uJEcZ6dkC7SNXxKi7BAb7r78ciFzmNdjo7eg@mail.gmail.com>

Tom Michaud <tom.michaud@gmail.com> writes:

> Hi all,
>
> Would someone kindly point me to a document that describes the
> workflow Junio et al use to develop git?

Documentation/howto/maintain-git.txt

The gitworkflows(7) manpage is also inspired by how development works
around here, and the pretty well-known

  http://nvie.com/posts/a-successful-git-branching-model/

has some pictures of a very similar workflow that you can look at.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox