Re: Our merge bases sometimes suck

2014-06-20 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: It just looks asymmetric, but actually it is symmetric, which was kindof surprising when I realized it Since |branch ∧ master| is the same for all candidates, minimizing N is the same as maximizing |candidate|, which is the same as git

Re: The different EOL behavior between libgit2-based software and official Git

2014-06-20 Thread Torsten Bögershausen
Hm, I feeled puzzled here. Even if I wouldn't recommend to use core.autocrlf, and prefer to use .gitattributes, the CRLF conversion should work under Git, but it doensn't seem to do so. Clone this repo: origin https://github.com/YueLinHo/TestAutoCrlf.git Try to see if LF or CRLF can be

Re: search for equivalent commits by patch-id

2014-06-20 Thread Jeff King
On Thu, Jun 19, 2014 at 03:26:17PM +0300, vicentiu.nea...@ni.com wrote: Is there a way to find all equivalent commits by patch-id? Something similar to: git branch -a --commit commit but instead of commit to search by patch-id. There isn't a ready-made command to do so, but you can

Re: The different EOL behavior between libgit2-based software and official Git

2014-06-20 Thread Yue Lin Ho
Wow! P.S. A note: libgit2 just has a PR that try to be identical with official git 2.0.0. See https://github.com/libgit2/libgit2/pull/2432 -- View this message in context:

Re: Our merge bases sometimes suck

2014-06-20 Thread Michael Haggerty
On 06/20/2014 08:53 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: It just looks asymmetric, but actually it is symmetric, which was kindof surprising when I realized it Since |branch ∧ master| is the same for all candidates, minimizing N is the same as

Re: [PATCH 10/16] fast-import: use skip_prefix for parsing input

2014-06-20 Thread Eric Sunshine
On Fri, Jun 20, 2014 at 1:45 AM, Jeff King p...@peff.net wrote: On Thu, Jun 19, 2014 at 11:19:09PM -0400, Eric Sunshine wrote: - if (starts_with(command_buf.buf, M )) - file_change_m(b); - else if (starts_with(command_buf.buf, D )) -

git gui - Linux

2014-06-20 Thread Ran Shalit
Hello, I am trying to initialize remote git and push complete folder files using git-gui. I'm Doing exactly the same sequence in windows with Git Gui works perfectly. But when doing remote-add in ubuntu, name: test Location: /home/ubuntu/test.git I get the following error: fatal: GIT_WORK_TREE

Re: [msysGit] Re: The different EOL behavior between libgit2-based software and official Git

2014-06-20 Thread Torsten Bögershausen
​Wow! P.S. libgit2 just has a PR that try to be identical with official git. See https://github.com/libgit2/libgit2/pull/2432 Yue Lin Ho I am not sure how much problems Git/libgit2 have with files contains mixed LF-CRLF, as I have the same problem with the LF.txt The handling,

Re: [RFC PATCH 1/7] rebase -i: Make option handling in pick_one more flexible

2014-06-20 Thread Michael Haggerty
On 06/19/2014 05:28 AM, Fabian Ruch wrote: `pick_one` and `pick_one_preserving_merges` are wrappers around `cherry-pick` in `rebase --interactive`. They take the hash of a commit and build a `cherry-pick` command line that - respects the user-supplied merge options - disables complaints

Re: [RFC PATCH 2/7] rebase -i: Teach do_pick the option --edit

2014-06-20 Thread Michael Haggerty
On 06/19/2014 05:28 AM, Fabian Ruch wrote: The to-do list command `reword` replays a commit like `pick` but lets the user also edit the commit's log message. If one thinks of `pick` entries as scheduled `cherry-pick` command lines, then `reword` becomes an alias for the command line

[PATCH v20 04/48] refs.c: allow passing NULL to ref_transaction_free

2014-06-20 Thread Ronnie Sahlberg
Allow ref_transaction_free(NULL) as a no-op. This makes ref_transaction_free easier to use and more similar to plain 'free'. In particular, it lets us rollback unconditionally as part of cleanup code after setting 'transaction = NULL' if a transaction has been committed or rolled back already.

[PATCH v20 00/48] Use ref transactions

2014-06-20 Thread Ronnie Sahlberg
This patch series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions This patch series is based on current master and expands on the transaction API. It converts all ref updates, inside refs.c as well as external, to use the transaction API for updates. This makes most of

[PATCH v20 05/48] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-06-20 Thread Ronnie Sahlberg
Add a strbuf argument to _commit so that we can pass an error string back to the caller. So that we can do error logging from the caller instead of from _commit. Longer term plan is to first convert all callers to use onerr==QUIET_ON_ERR and craft any log messages from the callers themselves and

[PATCH v20 07/48] lockfile.c: make lock_file return a meaningful errno on failurei

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from lock_file() meaningful, which should fix * an existing almost-bug in lock_ref_sha1_basic where it assumes errno==ENOENT is meaningful and could waste some work on retries * an existing bug in repack_without_refs where it prints strerror(errno) and picks

[PATCH v20 12/48] refs.c: commit_packed_refs to return a meaningful errno on failure

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from commit_packed_refs() meaningful, which should fix * a bug in git clone where it prints strerror(errno) based on errno, despite errno possibly being zero and potentially having been clobbered by that point * the same kind of bug in git pack-refs and

[PATCH v20 02/48] refs.c: ref_transaction_commit should not free the transaction

2014-06-20 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 1 + refs.c | 1 - refs.h | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/builtin/update-ref.c b/builtin/update-ref.c

[PATCH v20 44/48] refs.c: call lock_ref_sha1_basic directly from commit

2014-06-20 Thread Ronnie Sahlberg
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic directly from the commit function. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH v20 39/48] refs.c: make delete_ref use a transaction

2014-06-20 Thread Ronnie Sahlberg
Change delete_ref to use a ref transaction for the deletion. At the same time since we no longer have any callers of repack_without_ref we can now delete this function. Change delete_ref to return 0 on success and 1 on failure instead of the previous 0 on success either 1 or -1 on failure.

[PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-06-20 Thread Ronnie Sahlberg
Move the check for check_refname_format from lock_any_ref_for_update to lock_ref_sha1_basic. At some later stage we will get rid of lock_any_ref_for_update completely. If lock_ref_sha1_basic fails the check_refname_format test, set errno to EINVAL before returning NULL. This to guarantee that we

[PATCH v20 15/48] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-06-20 Thread Ronnie Sahlberg
Make ref_update_reject_duplicates return any error that occurs through a new strbuf argument. This means that when a transaction commit fails in this function we will now be able to pass a helpful error message back to the caller. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by:

[PATCH v20 42/48] refs.c: pass NULL as *flags to read_ref_full

2014-06-20 Thread Ronnie Sahlberg
We call read_ref_full with a pointer to flags from rename_ref but since we never actually use the returned flags we can just pass NULL here instead. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- 1 file changed, 1

[PATCH v20 38/48] refs.c: make prune_ref use a transaction to delete the ref

2014-06-20 Thread Ronnie Sahlberg
Change prune_ref to delete the ref using a ref transaction. To do this we also need to add a new flag REF_ISPRUNING that will tell the transaction that we do not want to delete this ref from the packed refs. This flag is private to refs.c and not exposed to external callers. Reviewed-by: Jonathan

[PATCH v20 01/48] refs.c: remove ref_transaction_rollback

2014-06-20 Thread Ronnie Sahlberg
We do not yet need both a rollback and a free function for transactions. Remove ref_transaction_rollback and use ref_transaction_free instead. At a later stage we may reintroduce a rollback function if we want to start adding reusable transactions and similar. Reviewed-by: Jonathan Nieder

[PATCH v20 08/48] refs.c: add an err argument to repack_without_refs

2014-06-20 Thread Ronnie Sahlberg
Update repack_without_refs to take an err argument and update it if there is a failure. Pass the err variable from ref_transaction_commit to this function so that callers can print a meaningful error message if _commit fails due to this function. Signed-off-by: Ronnie Sahlberg sahlb...@google.com

[PATCH v20 47/48] fetch.c: change s_update_ref to use a ref transaction

2014-06-20 Thread Ronnie Sahlberg
Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/fetch.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index faa1233..52f1ebc

[PATCH v20 48/48] refs.c: make write_ref_sha1 static

2014-06-20 Thread Ronnie Sahlberg
No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 10 -- refs.h | 3 --- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index 74a55b5..5a0b138 100644 --- a/refs.c +++

[PATCH v20 03/48] refs.c: constify the sha arguments for ref_transaction_create|delete|update

2014-06-20 Thread Ronnie Sahlberg
ref_transaction_create|delete|update has no need to modify the sha1 arguments passed to it so it should use const unsigned char* instead of unsigned char*. Some functions, such as fast_forward_to(), already have its old/new sha1 arguments as consts. This function will at some point need to use

[PATCH v20 40/48] refs.c: add an err argument to delete_ref_loose

2014-06-20 Thread Ronnie Sahlberg
Add an err argument to delete_loose_ref so that we can pass a descriptive error string back to the caller. Pass the err argument from transaction commit to this function so that transaction users will have a nice error string if the transaction failed due to delete_loose_ref. Add a new function

[PATCH v20 06/48] lockfile.c: add a new public function unable_to_lock_message

2014-06-20 Thread Ronnie Sahlberg
Introducing a new unable_to_lock_message helper, which has nicer semantics than unable_to_lock_error and cleans up lockfile.c a little. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- cache.h| 2 ++ lockfile.c | 22 -- 2 files changed, 14 insertions(+), 10

[PATCH v20 37/48] refs.c: remove lock_ref_sha1

2014-06-20 Thread Ronnie Sahlberg
lock_ref_sha1 was only called from one place in refc.c and only provided a check that the refname was sane before adding back the initial refs/ part of the ref path name, the initial refs/ that this caller had already stripped off before calling lock_ref_sha1. Reviewed-by: Jonathan Nieder

[PATCH v20 46/48] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-06-20 Thread Ronnie Sahlberg
In _commit, ENOTDIR can happen in the call to lock_ref_sha1_basic, either when we lstat the new refname and it returns ENOTDIR or if the name checking function reports that the same type of conflict happened. In both cases it means that we can not create the new ref due to a name conflict. For

[PATCH v20 45/48] refs.c: pass a skip list to name_conflict_fn

2014-06-20 Thread Ronnie Sahlberg
Allow passing a list of refs to skip checking to name_conflict_fn. There are some conditions where we want to allow a temporary conflict and skip checking those refs. For example if we have a transaction that 1, guarantees that m is a packed refs and there is no loose ref for m 2, the transaction

[PATCH v20 31/48] receive-pack.c: use a reference transaction for updating the refs

2014-06-20 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 96 +- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c

[PATCH v20 28/48] fast-import.c: change update_branch to use ref transactions

2014-06-20 Thread Ronnie Sahlberg
Change update_branch() to use ref transactions for updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fast-import.c

[PATCH v20 32/48] fast-import.c: use a ref transaction when dumping tags

2014-06-20 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/fast-import.c b/fast-import.c index d5206ee..a95e1be 100644 --- a/fast-import.c

[PATCH v20 34/48] refs.c: make lock_ref_sha1 static

2014-06-20 Thread Ronnie Sahlberg
No external callers reference lock_ref_sha1 any more so lets declare it static. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- refs.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/refs.c b/refs.c

[PATCH v20 35/48] refs.c: remove the update_ref_lock function

2014-06-20 Thread Ronnie Sahlberg
Since we now only call update_ref_lock with onerr==QUIET_ON_ERR we no longer need this function and can replace it with just calling lock_any_ref_for_update directly. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 30

[PATCH v20 26/48] commit.c: use ref transactions for updates

2014-06-20 Thread Ronnie Sahlberg
Change commit.c to use ref transactions for all ref updates. Make sure we pass a NULL pointer to ref_transaction_update if have_old is false. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/commit.c | 24 +++- 1

[PATCH v20 33/48] walker.c: use ref transaction for ref updates

2014-06-20 Thread Ronnie Sahlberg
Switch to using ref transactions in walker_fetch(). As part of the refactoring to use ref transactions we also fix a potential memory leak where in the original code if write_ref_sha1() would fail we would end up returning from the function without free()ing the msg string. Note that this

[PATCH v20 24/48] tag.c: use ref transactions when doing updates

2014-06-20 Thread Ronnie Sahlberg
Change tag.c to use ref transactions for all ref updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/tag.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index

[PATCH v20 36/48] refs.c: remove the update_ref_write function

2014-06-20 Thread Ronnie Sahlberg
Since we only call update_ref_write from a single place and we only call it with onerr==QUIET_ON_ERR we can just as well get rid of it and just call write_ref_sha1 directly. This changes the return status for _commit from 1 to -1 on failures when writing to the ref. Eventually we will want _commit

[PATCH v20 25/48] replace.c: use the ref transaction functions for updates

2014-06-20 Thread Ronnie Sahlberg
Update replace.c to use ref transactions for updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/replace.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c

[PATCH v20 29/48] branch.c: use ref transaction for all ref updates

2014-06-20 Thread Ronnie Sahlberg
Change create_branch to use a ref transaction when creating the new branch. This also fixes a race condition in the old code where two concurrent create_branch could race since the lock_any_ref_for_update/write_ref_sha1 did not protect against the ref already existing. I.e. one thread could end

[PATCH v20 27/48] sequencer.c: use ref transactions for all ref updates

2014-06-20 Thread Ronnie Sahlberg
Change to use ref transactions for all updates to refs. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- sequencer.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sequencer.c b/sequencer.c index

[PATCH v20 20/48] refs.c: change ref_transaction_create to do error checking and return status

2014-06-20 Thread Ronnie Sahlberg
Do basic error checking in ref_transaction_create() and make it return non-zero on error. Update all callers to check the result of ref_transaction_create(). There are currently no conditions in _create that will return error but there will be in the future. Add an err argument that will be

[PATCH v20 19/48] refs.c: change ref_transaction_update() to do error checking and return status

2014-06-20 Thread Ronnie Sahlberg
Update ref_transaction_update() do some basic error checking and return non-zero on error. Update all callers to check ref_transaction_update() for error. There are currently no conditions in _update that will return error but there will be in the future. Add an err argument that will be updated

[PATCH v20 22/48] refs.c: make ref_transaction_begin take an err argument

2014-06-20 Thread Ronnie Sahlberg
Add an err argument to _begin so that on non-fatal failures in future ref backends we can report a nice error back to the caller. While _begin can currently never fail for other reasons than OOM, in which case we die() anyway, we may add other types of backends in the future. For example, a

[PATCH v20 30/48] refs.c: change update_ref to use a transaction

2014-06-20 Thread Ronnie Sahlberg
Change the update_ref helper function to use a ref transaction internally. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/refs.c

[PATCH v20 21/48] refs.c: update ref_transaction_delete to check for error and return status

2014-06-20 Thread Ronnie Sahlberg
Change ref_transaction_delete() to do basic error checking and return non-zero of error. Update all callers to check the return for ref_transaction_delete(). There are currently no conditions in _delete that will return error but there will be in the future. Add an err argument that will be

[PATCH v20 23/48] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-06-20 Thread Ronnie Sahlberg
Track the status of a transaction in a new status field. Check the field for sanity, i.e. that status must be OPEN when _commit/_create/_delete or _update is called or else die(BUG:...) Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 40 +++- 1

[PATCH v20 18/48] refs.c: remove the onerr argument to ref_transaction_commit

2014-06-20 Thread Ronnie Sahlberg
Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr argument any more. Remove the onerr argument from the ref_transaction_commit signature. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 3

[PATCH v20 10/48] refs.c: verify_lock should set errno to something meaningful

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from verify_lock() meaningful, which should almost but not completely fix * a bug in git fetch's s_update_ref, which trusts the result of an errno == ENOTDIR check to detect D/F conflicts ENOTDIR makes sense as a sign that a file was in the way of a directory we

[PATCH v20 13/48] refs.c: make resolve_ref_unsafe set errno to something meaningful on error

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from resolve_ref_unsafe() meaningful, which should fix * a bug in lock_ref_sha1_basic, where it assumes EISDIR means it failed due to a directory being in the way Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- cache.h | 2 +- refs.c | 19

[PATCH v20 11/48] refs.c: make remove_empty_directories always set errno to something sane

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from remove_empty_directories() more obviously meaningful, which should provide some peace of mind for people auditing lock_ref_sha1_basic. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v20 14/48] refs.c: log_ref_write should try to return meaningful errno

2014-06-20 Thread Ronnie Sahlberg
Making errno from write_ref_sha1() meaningful, which should fix * a bug in git checkout -b where it prints strerror(errno)  despite errno possibly being zero or clobbered * a bug in git fetch's s_update_ref, which trusts the result of an  errno == ENOTDIR check to detect D/F conflicts

[PATCH v20 16/48] refs.c: make update_ref_write update a strbuf on failure

2014-06-20 Thread Ronnie Sahlberg
Change update_ref_write to also update an error strbuf on failure. This makes the error available to ref_transaction_commit callers if the transaction failed due to update_ref_sha1/write_ref_sha1 failures. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg

[PATCH v20 09/48] refs.c: make sure log_ref_setup returns a meaningful errno

2014-06-20 Thread Ronnie Sahlberg
Making errno when returning from log_ref_setup() meaningful, Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 27 +++ refs.h | 4 +++- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/refs.c b/refs.c index 67a0217..9ea519c 100644 ---

[PATCH v20 17/48] update-ref: use err argument to get error from ref_transaction_commit

2014-06-20 Thread Ronnie Sahlberg
Call ref_transaction_commit with QUIET_ON_ERR and use the strbuf that is returned to print a log message if/after the transaction fails. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 10 +- 1 file changed, 5

[PATCH v20 41/48] refs.c: pass the ref log message to _create/delete/update instead of _commit

2014-06-20 Thread Ronnie Sahlberg
Change the reference transactions so that we pass the reflog message through to the create/delete/update function instead of the commit message. This allows for individual messages for each change in a multi ref transaction. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie

Re: [msysGit] Re: The different EOL behavior between libgit2-based software and official Git

2014-06-20 Thread Junio C Hamano
Torsten Bögershausen tbo...@web.de writes: tb@Linux:~/EOL_Test/TestAutoCrlf$ t=LF.txtrm -f $t git -c core.eol=CRLF checkout $t od -c $t 000 L i n e 1 \n l i n e ( 2 ) \n 020 l i n e 3 . \n t h i s i s 040

Re: [RFC PATCH 1/7] rebase -i: Make option handling in pick_one more flexible

2014-06-20 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: pick_one () { ff=--ff +extra_args= +while test $# -gt 0 +do +case $1 in +-n) +ff= +extra_args=$extra_args -n +;; +-*) +

[PATCH v6 01/11] trace: move trace declarations from cache.h to new trace.h

2014-06-20 Thread Karsten Blees
Also include direct dependencies (strbuf.h and git-compat-util.h for __attribute__) so that trace.h can be used independently of cache.h, e.g. in test programs. Signed-off-by: Karsten Blees bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- cache.h | 13 ++--- trace.h | 17

[PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
Changes since v5: [05/11]: GIT_TRACE_BARE=1 disables 'timestamp file:line' output for unit tests that rely on trace output (t1510 and t5503) [08/11]: Align original trace output at col 40 [09/11]: Dropped '(div 10e9)' from the commit message. [10/11]: Dropped trace_performance[_since]()

[PATCH v6 03/11] trace: remove redundant printf format attribute

2014-06-20 Thread Karsten Blees
trace_printf_key() is the only non-static function that duplicates the printf format attribute in the .c file, remove it for consistency. Signed-off-by: Karsten Blees bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v6 02/11] trace: consistently name the format parameter

2014-06-20 Thread Karsten Blees
The format parameter to trace_printf functions is sometimes abbreviated 'fmt'. Rename to 'format' everywhere (consistent with POSIX' printf specification). Signed-off-by: Karsten Blees bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 22 +++--- trace.h

[PATCH v6 04/11] trace: factor out printing to the trace file

2014-06-20 Thread Karsten Blees
Opening and writing to the trace file is currently duplicated in trace_strbuf() and trace_argv_printf(). Factor out this logic to prepare for adding timestamp and file:line to trace output. In case of trace_argv_printf(), this adds an additional trace_want() check to prevent unnecessary string

[PATCH v6 06/11] trace: add current timestamp to all trace output

2014-06-20 Thread Karsten Blees
This is useful to tell apart trace output of separate test runs. It can also be used for basic, coarse-grained performance analysis. Note that the accuracy is tainted by writing to the trace file, and you have to calculate the deltas yourself (which is next to impossible if multiple threads or

[PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
To be able to add a common prefix or suffix to all trace output (e.g. a timestamp or file:line of the caller), factor out common setup and cleanup tasks of the trace* functions. Some unit-tests use trace output to verify internal state, and variable output such as timestamps and line numbers are

[PATCH v6 07/11] trace: move code around, in preparation to file:line output

2014-06-20 Thread Karsten Blees
No functional changes, just move stuff around so that the next patch isn't that ugly... Signed-off-by: Karsten Blees bl...@dcon.de Signed-off-by: Junio C Hamano gits...@pobox.com --- trace.c | 36 ++-- trace.h | 12 2 files changed, 26 insertions(+),

[PATCH v6 08/11] trace: add 'file:line' to all trace output

2014-06-20 Thread Karsten Blees
This is useful to see where trace output came from. Add 'const char *file, int line' parameters to the printing functions and rename them to *_fl. Add trace_printf* and trace_strbuf macros resolving to the *_fl functions and let the preprocessor fill in __FILE__ and __LINE__. As the

[PATCH v6 09/11] trace: add high resolution timer function to debug performance issues

2014-06-20 Thread Karsten Blees
Add a getnanotime() function that returns nanoseconds since 01/01/1970 as unsigned 64-bit integer (i.e. overflows in july 2554). This is easier to work with than e.g. struct timeval or struct timespec. Basing the timer on the epoch allows using the results with other time-related APIs. To

[PATCH v6 10/11] trace: add trace_performance facility to debug performance issues

2014-06-20 Thread Karsten Blees
Add trace_performance and trace_performance_since macros that print a duration and an optional printf-formatted text to the file specified in environment variable GIT_TRACE_PERFORMANCE. These macros, in conjunction with getnanotime(), are intended to simplify performance measurements from within

[PATCH v6 11/11] git: add performance tracing for git's main() function to debug scripts

2014-06-20 Thread Karsten Blees
Use trace_performance to measure and print execution time and command line arguments of the entire main() function. In constrast to the shell's 'time' utility, which measures total time of the parent process, this logs all involved git commands recursively. This is particularly useful to debug

Re: Our merge bases sometimes suck

2014-06-20 Thread Nico Williams
On Fri, Jun 20, 2014 at 1:53 AM, Junio C Hamano gits...@pobox.com wrote: Michael Haggerty mhag...@alum.mit.edu writes: [...] Hmph, but that obviously will become very expensive to compute as project grows. That's the main reason to like Fossil's approach (namely, the use of SQL, specifically

What's cooking in git.git (Jun 2014, #05; Fri, 20)

2014-06-20 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. Many topics that have been cooking in 'next' during the previous cycle and also some new topics since this cycle opened, totalling slightly

Re: Tool/Scripts - For maintaining different branches on a repo

2014-06-20 Thread brian m. carlson
On Thu, Jun 19, 2014 at 04:18:22PM +0530, Jagan Teki wrote: Hi, I have a single repo with different kinds of branches say 4 branches. Developers will send a patches wrt to specific branch. I presume here that you're referring to emailed patches, or patches in independent files, as opposed to

Re: [PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: To be able to add a common prefix or suffix to all trace output (e.g. a timestamp or file:line of the caller), factor out common setup and cleanup tasks of the trace* functions. Some unit-tests use trace output to verify internal state, and

Re: [PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Philip Oakley
From: Karsten Blees karsten.bl...@gmail.com Changes since v5: [05/11]: GIT_TRACE_BARE=1 disables 'timestamp file:line' output for unit tests that rely on trace output (t1510 and t5503) [08/11]: Align original trace output at col 40 [09/11]: Dropped '(div 10e9)' from the commit message.

Re: [PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:33, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: To be able to add a common prefix or suffix to all trace output (e.g. a timestamp or file:line of the caller), factor out common setup and cleanup tasks of the trace* functions. Some unit-tests use

Re: [PATCH v6 00/11] add performance tracing facility

2014-06-20 Thread Karsten Blees
Am 21.06.2014 00:49, schrieb Philip Oakley: Should there be some documentation as well? Perhaps in t/README, or in Documentation/howto. I'll add Documentation/technical/api-trace.txt when I find the time. But lets settle on the final API first. -- To unsubscribe from this list: send the line

Re: [RFC PATCH 3/7] rebase -i: Stop on root commits with empty log messages

2014-06-20 Thread Eric Sunshine
On Wed, Jun 18, 2014 at 11:28 PM, Fabian Ruch baf...@gmail.com wrote: When `rebase` is executed with `--root` but no `--onto` is specified, `rebase` creates a sentinel commit which is replaced with the root commit in three steps. This combination of options results never in a fast-forward.

Re: [PATCH v6 05/11] trace: add infrastructure to augment trace output with additional info

2014-06-20 Thread Junio C Hamano
On Fri, Jun 20, 2014 at 4:32 PM, Karsten Blees karsten.bl...@gmail.com wrote: Am 21.06.2014 00:33, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: GIT_TRACE_VERBOSE perhaps? It affects all trace output, not just GIT_TRACE_PERFORMANCE. The tests would still have to