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
>
> but instead of to search by patch-id.
There isn't a ready-made command to do so, but you can easily sc
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:
http://git.661346.n2.nabble.com/The-different-EOL-behavior-between-libgit2-based-software-and-official-Git-tp7613670p76138
On 06/20/2014 08:53 AM, Junio C Hamano wrote:
> Michael Haggerty 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 |ca
On Fri, Jun 20, 2014 at 1:45 AM, Jeff King 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 "))
>> > -
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 (
> 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 handlin
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 complai
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 `cherry
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.
Re
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
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 f
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 ad
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 pre
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
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
index 405267f..1fd7a89 100644
--- a/b
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic
directly from the commit function.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index bccf8c3..f
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.
Review
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 w
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
Signed-off-by: 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
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c
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
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
Signed
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
---
builtin/remote
Change s_update_ref to use a ref transaction for the ref update.
Signed-off-by: Ronnie Sahlberg
---
builtin/fetch.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --git a/builtin/fetch.c b/builtin/fetch.c
index faa1233..52f1ebc 100644
--- a/builti
No external users call write_ref_sha1 any more so lets declare it static.
Signed-off-by: Ronnie Sahlberg
---
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
+++ b/refs.c
@@ -2665,6
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 ref
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 un
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
---
cache.h| 2 ++
lockfile.c | 22 --
2 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/
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
Sig
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 the
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 w
Wrap all the ref updates inside a transaction.
Signed-off-by: Ronnie Sahlberg
---
builtin/receive-pack.c | 96 +-
1 file changed, 63 insertions(+), 33 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c323081..b51f8ae
Change update_branch() to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
fast-import.c | 24 ++--
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 6707a66..d5206ee 100644
--
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
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
+++ b/fast-import.c
@@ -1734,15 +1734,3
No external callers reference lock_ref_sha1 any more so lets declare it static.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 2 +-
refs.h | 6 --
2 files changed, 1 insertion(+), 7 deletions(-)
diff --git a/refs.c b/refs.c
index 4bdccc5..456acdd 100644
--- a/ref
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
Signed-off-by: Ronnie Sahlberg
---
refs.c | 30 ++
1 file changed, 6 in
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
Signed-off-by: Ronnie Sahlberg
---
builtin/commit.c | 24 +++-
1 file changed, 11 insertions(+), 13 dele
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 function
Change tag.c to use ref transactions for all ref updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/tag.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/tag.c b/builtin/tag.c
index c6e8a71..c9bfc9a 100644
--- a/builtin/t
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
Update replace.c to use ref transactions for updates.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
builtin/replace.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/builtin/replace.c b/builtin/replace.c
index 1bb491d..7528f3d 100644
--- a/b
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 up
Change to use ref transactions for all updates to refs.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
sequencer.c | 24
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index 0a80c58..fd8acaf 100644
--- a/sequenc
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 updated
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 on
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 hypothe
Change the update_ref helper function to use a ref transaction internally.
Reviewed-by: Jonathan Nieder
Signed-off-by: Ronnie Sahlberg
---
refs.c | 28
1 file changed, 24 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index 8c695ba..4bdccc5 100644
--- a
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 updated
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
---
refs.c | 40 +++-
1 file changed, 39 in
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
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 3 +--
refs.c | 22 +++--
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
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
---
cache.h | 2 +-
refs.c | 19 +++
2 files change
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
---
refs.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/refs.c b/refs.
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
Sign
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
Signed-off-by: Ronnie Sahlberg
---
refs.c | 9 ++---
1 f
Making errno when returning from log_ref_setup() meaningful,
Signed-off-by: Ronnie Sahlberg
---
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
--- a/refs.c
+++ b/refs.c
@@ -2
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
Signed-off-by: Ronnie Sahlberg
---
builtin/update-ref.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --
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
Signed-off-by: Ronnie Sahlberg
---
branch
Torsten Bögershausen writes:
tb@Linux:~/EOL_Test/TestAutoCrlf$ t=LF.txt && rm -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 l i
Michael Haggerty writes:
>> pick_one () {
>> ff=--ff
>> +extra_args=
>> +while test $# -gt 0
>> +do
>> +case "$1" in
>> +-n)
>> +ff=
>> +extra_args="$extra_args -n"
>> +;;
>> +-*)
>>
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
Signed-off-by: Junio C Hamano
---
cache.h | 13 ++---
trace.h | 17 +
2 files cha
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]() re
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
Signed-off-by: Junio C Hamano
---
trace.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/trace.c b/trace.c
index 37a7fa9..3e
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
Signed-off-by: Junio C Hamano
---
trace.c | 22 +++---
trace.h | 2 +-
2 files changed, 12 in
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 for
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 pro
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 n
No functional changes, just move stuff around so that the next patch isn't
that ugly...
Signed-off-by: Karsten Blees
Signed-off-by: Junio C Hamano
---
trace.c | 36 ++--
trace.h | 12
2 files changed, 26 insertions(+), 22 deletions(-)
diff --git a/t
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 trace_printf
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 simplify
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 t
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
perf
On Fri, Jun 20, 2014 at 1:53 AM, Junio C Hamano wrote:
> Michael Haggerty 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 SQLite3): you can write declara
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 more
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
Karsten Blees 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 variable
> output such a
From: "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_
Am 21.06.2014 00:33, schrieb Junio C Hamano:
> Karsten Blees 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
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 "
On Wed, Jun 18, 2014 at 11:28 PM, Fabian Ruch 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.
>
> 1. The sent
On Fri, Jun 20, 2014 at 4:32 PM, Karsten Blees wrote:
> Am 21.06.2014 00:33, schrieb Junio C Hamano:
>> Karsten Blees writes:
>
> GIT_TRACE_VERBOSE perhaps? It affects all trace output, not just
> GIT_TRACE_PERFORMANCE. The tests would still have to disable it
> explicitly, though, in case someon
80 matches
Mail list logo