Re: [PATCH] implemented strbuf_write_or_die()

2014-03-04 Thread Faiz Kothari
> I'm the guilty one. I like the change (obviously, since I suggested > it). Writing strbufs comes up frequently and will hopefully increase in > usage and I think it is a positive thing to encourage the use of strbufs > by making them increasingly first-class citizens. > > But I can see your poi

Re: [PATCH] Setup.c: PATH_MAX is the length including the Nil

2014-03-04 Thread Faiz Kothari
On Tue, Mar 4, 2014 at 9:59 PM, Sun He wrote: > Signed-off-by: Sun He > --- > > Check the limit.h of linux and find out that the MACRO > #define PATH_MAX4096/* # chars in a path name including nul */ > So if the magic number 40 is just the size it should be. (e.g. hash code) > It may

Fwd: [PATCH] implemented strbuf_write_or_die()

2014-03-03 Thread Faiz Kothari
On Tue, Mar 4, 2014 at 12:01 AM, Junio C Hamano wrote: > Eric Sunshine writes: > >> On Sat, Mar 1, 2014 at 7:51 AM, He Sun wrote: >>> 2014-03-01 19:21 GMT+08:00 Faiz Kothari : >>>> diff --git a/remote-curl.c b/remote-curl.c >>>> index 10cb011..dee87

[PATCH v3 2/2] use strbuf_write_or_die()

2014-03-01 Thread Faiz Kothari
Signed-off-by: Faiz Kothari Used strbuf.c:strbuf_write_or_die() instead of write_or_die.c:write_or_die() at relevant places. --- builtin/cat-file.c |2 +- builtin/notes.c|6 +++--- builtin/receive-pack.c |2 +- builtin/send-pack.c|2 +- builtin/stripspace.c

[PATCH v3 1/2] Introduce strbuf_write_or_die()

2014-03-01 Thread Faiz Kothari
Signed-off-by: Faiz Kothari Introduced a new function strbuf.c:strbuf_write_or_die() to the strbuf family of functions. Now use this API instead of write_or_die.c:write_or_die() --- Hi, Thanks for the suggestions and feedbacks. As Johannes Sixt pointed out, the function is now defined in

[PATCH v2] implemented strbuf_write_or_die()

2014-03-01 Thread Faiz Kothari
Signed-off-by: Faiz Kothari --- Thanks for the feedback. Implemented write_or_dir.c:strbuf_write_or_die() again. Checks if NULL is passed to prevent segmentation fault, I was not sure what error message to print so for now its "write error". Changed the prototype as suggested. Impleme

[PATCH] implemented strbuf_write_or_die()

2014-03-01 Thread Faiz Kothari
Signed-off-by: Faiz Kothari --- > > - write_or_die(1, rpc.result.buf, rpc.result.len); > > + strbuf_write_or_die(1, &(rpc.result.buf)); > May be this should be > strbuf_write_or_die(1, &(rpc.result)); Yes, I changed that :-) Thanks ag

[PATCH] implemented strbuf_write_or_die()

2014-03-01 Thread Faiz Kothari
Signed-off-by: Faiz Kothari --- Implemented write_or_die.c:strbuf_write_or_die() and used in relevant places to substitute write_or_die(). I spotted other places where strbuf can be used in place of buf[MAX_PATH] but that would require a change in prototype of a lot of functions and functions

Re: [PATCH] rewrite finish_bulk_checkin() using strbuf

2014-03-01 Thread Faiz Kothari
On Sat, Mar 1, 2014 at 4:33 PM, He Sun wrote: > 2014-03-01 15:18 GMT+08:00 Faiz Kothari : >> Hi, >> Yup, at that position. >> I don't know, but it failed a few tests on my machine related to bitmap. >> Another thing to use would be strbuf_splice() > >

[PATCH] rewrite finish_bulk_checkin() using strbuf

2014-02-28 Thread Faiz Kothari
From: Faiz Kotahri Signed-off-by: Faiz Kothari --- Sticking with implementation involving changing the prototype for pack-write.c:finish_tmp_packfile() Fixing a small bug in Sun He's implementation which caused a fail in some tests. builtin/pack-objects.c |

Re: [PATCH] rewrite bulk-checkin.c:finish_bulk_checkin() using strbuf

2014-02-28 Thread Faiz Kothari
, 2014 at 2:58 AM, Faiz Kothari wrote: >> Signed-off-by: Faiz Kothari >> >> Notes: >> I finally got what's happening, and why the errors were caused. >> packname is supposed to contain the complete path to the .pack file. >> Packs are stored as /p

[PATCH] rewrite bulk-checkin.c:finish_bulk_checkin() using strbuf

2014-02-27 Thread Faiz Kothari
Signed-off-by: Faiz Kothari Notes: I finally got what's happening, and why the errors were caused. packname is supposed to contain the complete path to the .pack file. Packs are stored as /path/to/.pack which I overlooked earlier. After inspecting what is happening in

[PATCH] Problem in bulk-checkin.c:finish_bulk_checkin() Unable to fix

2014-02-27 Thread Faiz Kothari
Signed-off-by: Faiz Kothari --- Compiles without errors. Fails in test t/t1050-large.sh ,fails 12/15 tests. Dumps memory map and backtrace. Somewhere its not able to free(): invalid pointer. Please somone pointout where I am doing it wrong. Help is really appreciated. Thanks. bulk-checkin.c

Re: [PATCH] GSoC2014 Microproject rewrite finish_bulk_checkin()

2014-02-27 Thread Faiz Kothari
l Haggerty wrote: > On 02/27/2014 08:02 PM, Faiz Kothari wrote: >> Signed-off-by: Faiz Kothari >> --- >> bulk-checkin.c | 12 +++- >> 1 file changed, 7 insertions(+), 5 deletions(-) >> >> diff --git a/bulk-checkin.c b/bulk-checkin.c >> index 118c62

[PATCH] GSoC2014 Microproject rewrite finish_bulk_checkin()

2014-02-27 Thread Faiz Kothari
Signed-off-by: Faiz Kothari --- bulk-checkin.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bulk-checkin.c b/bulk-checkin.c index 118c625..feeff9f 100644 --- a/bulk-checkin.c +++ b/bulk-checkin.c @@ -23,7 +23,7 @@ static struct bulk_checkin_state { static

[PATCH] rewrite skip_prefix() as loop

2014-02-27 Thread Faiz Kothari
From: Faiz Kothari Signed-off-by: Faiz Kothari --- git-compat-util.h |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/git-compat-util.h b/git-compat-util.h index cbd86c3..bb2582a 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -357,8 +357,11 @@ extern

Re: [PATCH] GSoC 2014 Microproject 1 rewrite skip_prefix() as loop

2014-02-27 Thread Faiz Kothari
just changed it to return a (const char *) accordingly. On Thu, Feb 27, 2014 at 5:02 PM, Michael Haggerty wrote: > On 02/26/2014 05:46 PM, Faiz Kothari wrote: >> I am Faiz Kothari, I am a GSoC aspirant and want to contribute to git. >> I am submitting the patch in reponse to Microproje

[PATCH] GSoC 2014 Microproject 1 rewrite skip_prefix() as loop

2014-02-26 Thread Faiz Kothari
Hi, I am Faiz Kothari, I am a GSoC aspirant and want to contribute to git. I am submitting the patch in reponse to Microproject 1, rewrite git-compat-util.h:skip_prefix() as a loop. Signed-off-by: Faiz Kothari --- git-compat-util.h | 7 +-- 1 file changed, 5 insertions(+), 2 deletions