Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)

2014-07-23 Thread Philip Oakley
From: Junio C Hamano gits...@pobox.com -- [Stalled] * po/everyday-doc (2014-01-27) 1 commit - Make 'git help everyday' work This may make the said command to emit something, but the source is not meant to be formatted into a manual pages to

Re: confused about remote branch management

2014-07-23 Thread Chris Packham
On 23/07/14 14:49, Ross Boylan wrote: My local master branch is the result of a merge of upstream master and some local changes. I want to merge in more recent upstream work. git pull doesn't seem to have updated origin/master, and git checkout origin/master also doesn't seem to work.

Re: [PATCH v7 23/31] checkout: clean up half-prepared directories in --to mode

2014-07-23 Thread Duy Nguyen
On Mon, Jul 21, 2014 at 6:55 AM, Eric Sunshine sunsh...@sunshineco.com wrote: @@ -848,13 +878,21 @@ static int prepare_linked_checkout(const struct checkout_opts *opts, strbuf_addf(sb_repo, %d, counter); } name = strrchr(sb_repo.buf, '/') + 1; + +

Re: [PATCH] config.c: change the function signature of `git_config_string()`

2014-07-23 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: *1* We have safe_create_leading_directories_const() that works around this for input parameter around its _const less counterpart, which is ugly but livable solution. I think it would actually be a reasonable solution to avoid casting here and there on

[PATCH 0/5] nd/multiple-work-trees follow-ups

2014-07-23 Thread Nguyễn Thái Ngọc Duy
The series has entered 'next' so I can't replace patches any more. Besides the brown paper bag fixes, checkout now rejects if a branch is already checked out elsewhere. Nguyễn Thái Ngọc Duy (5): gitrepository-layout.txt: s/ignored/ignored if/ prune --repos: fix uninitialized access checkout

[PATCH 2/5] prune --repos: fix uninitialized access

2014-07-23 Thread Nguyễn Thái Ngọc Duy
There's a code path in prune_repo_dir() that does not initialize 'st' buffer, which is checked by the caller, prune_repos_dir(). Instead of leaking some prune logic out to prune_repos_dir(), move 'st' into prune_repo_dir(). Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com ---

[PATCH 1/5] gitrepository-layout.txt: s/ignored/ignored if/

2014-07-23 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/gitrepository-layout.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/gitrepository-layout.txt b/Documentation/gitrepository-layout.txt index bed4f1a..6bd82af 100644 ---

[PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Nguyễn Thái Ngọc Duy
Give the user a choice in this case. If they want to detach, they can go with '--detach --to ...', or they could switch branch of the checkout that's holding the ref in question. Or they could just create a new branch with '-b xxx --to yyy' Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH 5/5] environment.c: fix incorrect git_graft_file initialization

2014-07-23 Thread Nguyễn Thái Ngọc Duy
info/grafts should be part of the common repository when accessed from a linked checkout (iow $GIT_COMMON_DIR/info/grafts, not $GIT_DIR/info/grafts). git_path(info/grafts) returns correctly, even without this fix, because it detects that $GIT_GRAFT_FILE is not set, so it goes with the common

[PATCH 4/5] checkout --to: fix dangling pointers in remove_junk()

2014-07-23 Thread Nguyễn Thái Ngọc Duy
junk_git_dir is set to sb_repo.buf. By the end of prepare_linked_checkout(), sb_repo is freed and so junk_git_dir points to nowhere. If the second checkout command fails, is_junk remains non-zero, remove_junk() will be called and try to clean junk_git_dir, which could be anything now (if it does

Re: Bug in get_pwd_cwd() in Windows?

2014-07-23 Thread Duy Nguyen
On Wed, Jul 23, 2014 at 2:35 AM, René Scharfe l@web.de wrote: Am 21.07.2014 16:13, schrieb Duy Nguyen: This function tests if $PWD is the same as getcwd() using st_dev and st_ino. But on Windows these fields are always zero (mingw.c:do_lstat). If cwd is moved away, I think falling back to

Re: [PATCH v2 2/2] Make locked paths absolute when current directory is changed

2014-07-23 Thread Duy Nguyen
On Tue, Jul 22, 2014 at 12:04 AM, Junio C Hamano gits...@pobox.com wrote: Duy Nguyen pclo...@gmail.com writes: On Mon, Jul 21, 2014 at 8:27 PM, Ramsay Jones ram...@ramsay1.demon.co.uk wrote: +void make_locked_paths_absolute(void) +{ + struct lock_file *lk; + for (lk =

[PATCH 2/2] .mailmap: Combine my emails

2014-07-23 Thread Stefan Beller
Google mail has had the extension @googlemail.com for a long time in Germany as @gmail.de was already taken by a competitor. Nowadays the original gmail company isn't there anymore(?), hence Googlemail also introduced @gmail.com in Germany, which I switched to. This changed mail address of mine

[PATCH 1/2] General Manpage: Switch homepage for stats

2014-07-23 Thread Stefan Beller
According to http://meta.ohloh.net/2014/07/black-duck-open-hub/ the site name of ohloh changed to openhub. Change the man page accordingly. Signed-off-by: Stefan Beller stefanbel...@gmail.com --- Documentation/git.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: Bug in get_pwd_cwd() in Windows?

2014-07-23 Thread Karsten Blees
Am 23.07.2014 13:53, schrieb Duy Nguyen: On Wed, Jul 23, 2014 at 2:35 AM, René Scharfe l@web.de wrote: Am 21.07.2014 16:13, schrieb Duy Nguyen: This function tests if $PWD is the same as getcwd() using st_dev and st_ino. But on Windows these fields are always zero (mingw.c:do_lstat). If

Re: confused about remote branch management

2014-07-23 Thread Kevin
On Jul 23, 2014 5:11 AM, Ross Boylan r...@biostat.ucsf.edu wrote: My local master branch is the result of a merge of upstream master and some local changes. I want to merge in more recent upstream work. git pull doesn't seem to have updated origin/master, and git checkout origin/master also

rebase flattens history when it shouldn't?

2014-07-23 Thread Sergei Organov
Hello, $ git --version git version 1.9.3 Please consider the following history: --C-- / \ / M topic,HEAD / / A---B master shouldn't $ git rebase master be a no-op here? According to my reading of the rebase manual page, it should be a no-op, as 'topic' is a

Unify subcommand structure; introduce double dashes for all subcommands?

2014-07-23 Thread Stefan Beller
In the user survey 2012 question 23 (In your opinion, which areas in Git need improvement?), the most crucial point identified was the user interface. I wonder if there are any more recent surveys, showing if this has changed. Now when we want to improve the user interface, we're likely talking

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Michael J Gruber
Nguyễn Thái Ngọc Duy venit, vidit, dixit 23.07.2014 13:43: Give the user a choice in this case. If they want to detach, they can go with '--detach --to ...', or they could switch branch of the checkout that's holding the ref in question. Or they could just create a new branch with '-b xxx --to

Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)

2014-07-23 Thread Karsten Blees
Am 22.07.2014 23:44, schrieb Junio C Hamano: * sk/mingw-uni-fix-more (2014-07-21) 14 commits - Win32: enable color output in Windows cmd.exe - Win32: patch Windows environment on startup - Win32: keep the environment sorted - Win32: use low-level memory allocation during initialization

[PATCH 00/15] ref-transactions for reflogs

2014-07-23 Thread Ronnie Sahlberg
List, Jun, This is the next patch series for ref-transactions. It is also available at https://github.com/rsahlberg/git/tree/ref-transactions-reflog and is the same patch series that has been posted previously with one exception: This series now contains an additional patch that fixes ref

[PATCH 04/15] refs.c: add a new update_type field to ref_update

2014-07-23 Thread Ronnie Sahlberg
Add a field that describes what type of update this refers to. For now the only type is UPDATE_SHA1 but we will soon add more types. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/refs.c

[PATCH 01/15] refs.c make ref_transaction_create a wrapper to ref_transaction_update

2014-07-23 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 18 ++ refs.h | 7 --- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/refs.c b/refs.c index 6dcb920..8f2aa3a 100644 --- a/refs.c +++ b/refs.c @@ -3490,28 +3490,14 @@ int

[PATCH 06/15] lockfile.c: make hold_lock_file_for_append preserve meaningful errno

2014-07-23 Thread Ronnie Sahlberg
Update hold_lock_file_for_append and copy_fd to return a meaningful errno on failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- copy.c | 20 +--- lockfile.c | 7 ++- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/copy.c b/copy.c index

[PATCH 08/15] refs.c: add a flag to allow reflog updates to truncate the log

2014-07-23 Thread Ronnie Sahlberg
Add a flag that allows us to truncate the reflog before we write the update. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 17 +++-- refs.h | 10 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c index b010d6d..181c957 100644

[PATCH 07/15] refs.c: add a transaction function to append a reflog entry

2014-07-23 Thread Ronnie Sahlberg
Define a new transaction update type, UPDATE_LOG, and a new function transaction_update_reflog. This function will lock the reflog and append an entry to it during transaction commit. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 103

[PATCH 11/15] reflog.c: use a reflog transaction when writing during expire

2014-07-23 Thread Ronnie Sahlberg
Use a transaction for all updates during expire_reflog. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/reflog.c | 84 refs.c | 4 +-- refs.h | 2 +- 3 files changed, 39 insertions(+), 51 deletions(-)

[PATCH 03/15] refs.c: rename the transaction functions

2014-07-23 Thread Ronnie Sahlberg
Rename the transaction functions. Remove the leading ref_ from the names and append _sha1 to the names for functions that create/delete/ update sha1 refs. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- branch.c | 11 --- builtin/commit.c | 14 -

[PATCH 05/15] refs.c: add a function to append a reflog entry to a fd

2014-07-23 Thread Ronnie Sahlberg
Break out the code to create the string and writing it to the file descriptor from log_ref_write and into a dedicated function log_ref_write_fd. For now this is only used from log_ref_write but later on we will call this function from reflog transactions too which means that we will end up with

[PATCH 12/15] refs.c: rename log_ref_setup to create_reflog

2014-07-23 Thread Ronnie Sahlberg
log_ref_setup is used to do several semi-related things : * sometimes it will create a new reflog including missing parent directories and cleaning up any conflicting stale directories in the path. * fill in a filename buffer for the full path to the reflog. * unconditionally re-adjust the

[PATCH 09/15] refs.c: only write reflog update if msg is non-NULL

2014-07-23 Thread Ronnie Sahlberg
When performing a reflog transaction update, only write to the reflog iff msg is non-NULL. This can then be combined with REFLOG_TRUNCATE to perform an update that only truncates but does not write. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 5 +++-- refs.h | 1 + 2 files

[PATCH 02/15] refs.c: make ref_transaction_delete a wrapper for ref_transaction_update

2014-07-23 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 17 + refs.h | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/refs.c b/refs.c index 8f2aa3a..74fb797 100644 --- a/refs.c +++ b/refs.c @@ -3506,24 +3506,17 @@ int ref_transaction_delete(struct

[PATCH 10/15] refs.c: allow multiple reflog updates during a single transaction

2014-07-23 Thread Ronnie Sahlberg
Allow to make multiple reflog updates to the same ref during a transaction. This means we only need to lock the reflog once, during the first update that touches the reflog, and that all further updates can just write the reflog entry since the reflog is already locked. This allows us to write

[PATCH 13/15] refs.c: make unlock_ref/close_ref/commit_ref static

2014-07-23 Thread Ronnie Sahlberg
unlock|close|commit_ref can be made static since there are no more external callers. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 24 refs.h | 9 - 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH 15/15] refs.c: allow deleting refs with a broken sha1

2014-07-23 Thread Ronnie Sahlberg
Add (back?) support to make it possible to delete refs that are broken. Add a new flag REF_ALLOWBROKEN that can be passed to the functions to lock a ref. If this flag is set we allow locking the ref even if the ref points to a broken sha1. For example a sha1 that is created by : echo Broken

[PATCH 14/15] refs.c: remove lock_any_ref_for_update

2014-07-23 Thread Ronnie Sahlberg
No one is using this function so we can delete it. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 7 --- refs.h | 10 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/refs.c b/refs.c index b74e5ff..0ead11f 100644 --- a/refs.c +++ b/refs.c @@

Re: [PATCH] config.c: change the function signature of `git_config_string()`

2014-07-23 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Junio C Hamano gits...@pobox.com writes: *1* We have safe_create_leading_directories_const() that works around this for input parameter around its _const less counterpart, which is ugly but livable solution. I think it would actually be a

Re: [PATCH 3/5] checkout --to: no auto-detach if the ref is already checked out

2014-07-23 Thread Junio C Hamano
Michael J Gruber g...@drmicha.warpmail.net writes: +if (advice_checkout_to) +die(_(%s is already checked out at %s.\n + Either use --detach or -b together with --to + or switch branch in the the other checkout.), or switch to a different

Re: rebase flattens history when it shouldn't?

2014-07-23 Thread Jonathan Nieder
Hi Sergei, Sergei Organov wrote: --C-- / \ / M topic,HEAD / / A---B master shouldn't $ git rebase master be a no-op here? [...] I'd expect --force-rebase to be required for this to happen: -f, --force-rebase Force the rebase even if the current

Re: Unify subcommand structure; introduce double dashes for all subcommands?

2014-07-23 Thread Junio C Hamano
Stefan Beller stefanbel...@gmail.com writes: A git command is generally setup as: git command [subcommand] [options] ... The subcommands vary wildly by the nature of the command. However all subcommands could at least follow one style. The commands bundle, notes, stash and submodule

Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)

2014-07-23 Thread Junio C Hamano
Philip Oakley philipoak...@iee.org writes: * po/everyday-doc (2014-01-27) 1 commit - Make 'git help everyday' work This may make the said command to emit something, but the source is not meant to be formatted into a manual pages to begin with, and also its contents are a bit stale. It may

Re: What's cooking in git.git (Jul 2014, #04; Tue, 22)

2014-07-23 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Am 22.07.2014 23:44, schrieb Junio C Hamano: * sk/mingw-uni-fix-more (2014-07-21) 14 commits ... * sk/mingw-tests-workaround (2014-07-21) 6 commits ... Yes, I think both series are ready. Compiles with msysgit and MSVC (with NO_CURL=1).

[PATCH 1/7] config.c: fix accuracy of line number in errors

2014-07-23 Thread Tanay Abhra
If a callback returns a negative value to `git_config*()` family, they call `die()` while printing the line number and the file name. Currently the printed line number is off by one, thus printing the wrong line number. Make `linenr` point to the line we just parsed during the call to callback to

[PATCH 6/7] config: add `git_die_config()` to the config-set API

2014-07-23 Thread Tanay Abhra
Add `git_die_config` that dies printing the line number and the file name of the highest priority value for the configuration variable `key`. It has usage in non-callback based config value retrieval where we can raise an error and die if there is a semantic error. For example, if

[PATCH 3/7] add a test for semantic errors in config files

2014-07-23 Thread Tanay Abhra
Semantic errors (for example, for alias.* variables NULL values are not allowed) in configuration files cause a die printing the line number and file name of the offending value. Add a test documenting that such errors cause a die printing the accurate line number and file name. Signed-off-by:

[PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-23 Thread Tanay Abhra
This series builds on the top of 5def4132 (ta/config-set) in pu or topic[1] in the mailing list with name git config cache special querying API utilizing the cache. This series aims to do these three things, * Use the config-set API to rewrite git_config(). * Solve any legacy bugs in the

[PATCH 7/7] Add tests for `git_config_get_string()`

2014-07-23 Thread Tanay Abhra
Add tests for `git_config_get_string()`, check whether it dies printing the line number and the file name if an NULL value is retrieved for the given key. Signed-off-by: Tanay Abhra tanay...@gmail.com --- t/t1308-config-set.sh | 9 + test-config.c | 10 ++ 2 files

[PATCH 4/7] add line number and file name info to `config_set`

2014-07-23 Thread Tanay Abhra
Store file name and line number for each key-value pair in the cache. Use the information to print line number and file name in errors raised by `git_config()` which now uses the configuration files caching layer internally. Signed-off-by: Tanay Abhra tanay...@gmail.com --- config.c | 32

[PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Tanay Abhra
Of all the functions in `git_config*()` family, `git_config()` has the most invocations in the whole code base. Each `git_config()` invocation causes config file rereads which can be avoided using the config-set API. Use the config-set API to rewrite `git_config()` to use the config caching layer

[PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-23 Thread Tanay Abhra
t4018-diff-funcname.sh fails for the new `git_config()` which uses the configuration files caching layer internally. The test introduced in commit d64d6cdc checks that whether `xfuncname` takes precedence over `funcname` variable which was not guaranteed by config API previously and worked only

Re: confused about remote branch management

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 15:09 +0200, Kevin wrote: On Jul 23, 2014 5:11 AM, Ross Boylan r...@biostat.ucsf.edu wrote: My local master branch is the result of a merge of upstream master and some local changes. I want to merge in more recent upstream work. git pull doesn't seem to have

[PATCH/RFC] sparse: avoid sse2 code which renders sparse useless

2014-07-23 Thread Ramsay Jones
Commit 745224e0 (refs.c: SSE2 optimizations for check_refname_\ component, 18-06-2014) introduces (on x86_64) the use of sse2 code, and associated header files, to optimize some reference handling code. This causes sparse to implode and exit with too many errors, among other things, while

Re: confused about remote branch management

2014-07-23 Thread Ross Boylan
I still don't know what I need to do to update origin/master in my local repo. Regarding Kevin's suggestion, I just tried git fetch origin master. It seems to have made no difference, at least judging by git show origin/master. I'm assuming the commit it show is the head of the branch. For

Re: rebase flattens history when it shouldn't?

2014-07-23 Thread Sergei Organov
Jonathan Nieder jrnie...@gmail.com writes: Hi Sergei, Sergei Organov wrote: --C-- / \ / M topic,HEAD / / A---B master shouldn't $ git rebase master be a no-op here? [...] I'd expect --force-rebase to be required for this to happen: -f, --force-rebase

Re: [PATCH v2 1/3] completion: complete unstuck `git push --recurse-submodules`

2014-07-23 Thread John Keeping
On Tue, Jul 22, 2014 at 02:17:13PM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: Do you want me to re-roll with this change or can you replace the patch while applying? I think I had to flip the third one to adjust to the change I suggested to this; the result

Re: [PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: This series builds on the top of 5def4132 (ta/config-set) in pu or topic[1] Not exactly: 5def4132 has been replaced in pu, and it does not contain tests, hence PATCH 3 does not apply on top of 5def4132. The series applies to 0912a24, but does not compile,

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: -int git_config(config_fn_t fn, void *data) +static int git_config_raw(config_fn_t fn, void *data) As you noticed already, this change breaks several tests. You are going to repair them later in the series, but your patch series produces a non-bisectable

Re: [PATCH 3/7] add a test for semantic errors in config files

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'check line errors for malformed values' ' + cp .git/config .git/config.old + test_when_finished mv .git/config.old .git/config + echo [alias]\n br .git/config + test_expect_code 128 git br 2result + grep

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: +static int configset_iter(struct config_set *cs, config_fn_t fn, void *data) +{ + int i; + struct string_list *strptr; + struct config_set_element *entry; + struct hashmap_iter iter; + hashmap_iter_init(cs-config_hash, iter); +

Re: [PATCH 2/5] prune --repos: fix uninitialized access

2014-07-23 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: There's a code path in prune_repo_dir() that does not initialize 'st' buffer, which is checked by the caller, prune_repos_dir(). Instead of leaking some prune logic out to prune_repos_dir(), move 'st' into prune_repo_dir(). Signed-off-by:

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: Also `funcname` variable is deprecated and not documented properly. I'd say purposely undocumented (see 45d9414fa5, Brandon Casey, Sep 18 2008). -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line unsubscribe

Re: [PATCH 7/7] Add tests for `git_config_get_string()`

2014-07-23 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: Add tests for `git_config_get_string()`, check whether it dies printing the line number and the file name if an NULL a NULL (no n). -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line unsubscribe git in the

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-23 Thread Eric Sunshine
On Wed, Jul 23, 2014 at 2:42 PM, Tanay Abhra tanay...@gmail.com wrote: t4018-diff-funcname.sh fails for the new `git_config()` which uses the configuration files caching layer internally. The test introduced in commit d64d6cdc checks that whether `xfuncname` takes s/that// precedence over

Re: [PATCH 15/15] refs.c: allow deleting refs with a broken sha1

2014-07-23 Thread Eric Sunshine
On Wed, Jul 23, 2014 at 1:03 PM, Ronnie Sahlberg sahlb...@google.com wrote: Add (back?) support to make it possible to delete refs that are broken. Add a new flag REF_ALLOWBROKEN that can be passed to the functions to lock a ref. If this flag is set we allow locking the ref even if the ref

Re: [PATCH 5/5] environment.c: fix incorrect git_graft_file initialization

2014-07-23 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: info/grafts should be part of the common repository when accessed from a linked checkout (iow $GIT_COMMON_DIR/info/grafts, not $GIT_DIR/info/grafts). git_path(info/grafts) returns correctly, even without this fix, because it detects that

Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?

2014-07-23 Thread Christoph Bonitz
On Mon, Jul 7, 2014 at 11:14 PM, Junio C Hamano gits...@pobox.com wrote: Choosing any of these as the copy source is fine is a sensible way to fix the problem with this test. Would it be a better solution to avoid having multiple/ambiguous copy source candidates in the first place, by the

[PATCH] git p4 test: fix failure in 9814-git-p4-rename.sh Was: Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?

2014-07-23 Thread Christoph Bonitz
The scenario in the rename test makes unnecessary assumptions about which file git file-tree will detect as a source for a copy-operations. Furthermore, copy detection is not tested by checking the resulting perforce revision history via p4 filelog, but via git diff-tree. This patch makes the

Re: [PATCH v2 1/3] completion: complete unstuck `git push --recurse-submodules`

2014-07-23 Thread Junio C Hamano
John Keeping j...@keeping.me.uk writes: On Tue, Jul 22, 2014 at 02:17:13PM -0700, Junio C Hamano wrote: John Keeping j...@keeping.me.uk writes: Do you want me to re-roll with this change or can you replace the patch while applying? I think I had to flip the third one to adjust to the

Re: confused about remote branch management

2014-07-23 Thread Junio C Hamano
Ross Boylan r...@biostat.ucsf.edu writes: I still don't know what I need to do to update origin/master in my local repo. Regarding Kevin's suggestion, I just tried git fetch origin master. I think Kevin's suggestion was 'To older git, git fetch origin master tells it to fetch master without

Re: [PATCH 0/7] Rewrite `git_config()` using config-set API

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: This series builds on the top of 5def4132 (ta/config-set) in pu or topic[1] in the mailing list with name git config cache special querying API utilizing the cache. This series aims to do these three things, * Use the config-set API to rewrite

Re: [PATCH 1/7] config.c: fix accuracy of line number in errors

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: If a callback returns a negative value to `git_config*()` family, they call `die()` while printing the line number and the file name. Currently the printed line number is off by one, thus printing the wrong line number. Make `linenr` point to the line

Re: [PATCH 2/7] rewrite git_config() to use the config-set API

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: Of all the functions in `git_config*()` family, `git_config()` has the most invocations in the whole code base. Each `git_config()` invocation causes config file rereads which can be avoided using the config-set API. Use the config-set API to rewrite

Re: [PATCH] git-svn: doublecheck if really file or dir

2014-07-23 Thread Eric Wong
Andrej Manduch amand...@gmail.com wrote: * this fixes 'git svn info `pwd`' buggy behaviour Good catch, the commit could use a better description, something like: --- 8 Subject: [PATCH] git-svn: info checks for dirs more carefully This avoids

Re: [PATCH 3/7] add a test for semantic errors in config files

2014-07-23 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Tanay Abhra tanay...@gmail.com writes: +test_expect_success 'check line errors for malformed values' ' +cp .git/config .git/config.old Should this be mv not cp? You will be overwriting the file from scratch in the later part of this

Re: [PATCH 4/7] add line number and file name info to `config_set`

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: @@ -1287,6 +1300,8 @@ static struct config_set_element *configset_find_element(struct config_set *cs, static int configset_add_value(struct config_set *cs, const char *key, const char *value) { struct config_set_element *e; + struct

Re: [PATCH] git-svn: Initialize SVN::Client with svn config instead of, auth for git svn branch.

2014-07-23 Thread Eric Wong
Monard Vong travelingsou...@gmail.com wrote: If a client certificate is required to connect to svn, git svn branch always prompt the user for the certificate location and password, even though those parameters are stored in svn file server located in svn config dir (generally ~/.subversion).

Re: [PATCH 5/7] enforce `xfuncname` precedence over `funcname`

2014-07-23 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: t4018-diff-funcname.sh fails for the new `git_config()` which uses the configuration files caching layer internally. The test introduced in commit d64d6cdc checks that whether `xfuncname` takes precedence over `funcname` variable which was not guaranteed

Re: [PATCH 01/15] refs.c make ref_transaction_create a wrapper to ref_transaction_update

2014-07-23 Thread Junio C Hamano
Ronnie Sahlberg sahlb...@google.com writes: Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 18 ++ refs.h | 7 --- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/refs.c b/refs.c index 6dcb920..8f2aa3a 100644 --- a/refs.c +++ b/refs.c

Re: [PATCH] git p4 test: fix failure in 9814-git-p4-rename.sh Was: Re: Test failure in t9814-git-p4-rename.sh - my environment or bad test?

2014-07-23 Thread Pete Wyckoff
ml.christophbon...@gmail.com wrote on Wed, 23 Jul 2014 23:28 +0200: The scenario in the rename test makes unnecessary assumptions about which file git file-tree will detect as a source for a copy-operations. Furthermore, copy detection is not tested by checking the resulting perforce revision

Re: [PATCH 00/15] ref-transactions for reflogs

2014-07-23 Thread Junio C Hamano
Ronnie Sahlberg sahlb...@google.com writes: This is the next patch series for ref-transactions. It is also available at https://github.com/rsahlberg/git/tree/ref-transactions-reflog and is the same patch series that has been posted previously with one exception: I've received, queued and

Re: confused about remote branch management

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 14:41 -0700, Junio C Hamano wrote: Ross Boylan r...@biostat.ucsf.edu writes: I still don't know what I need to do to update origin/master in my local repo. Regarding Kevin's suggestion, I just tried git fetch origin master. I think Kevin's suggestion was 'To

Re: confused about remote branch management

2014-07-23 Thread Junio C Hamano
Ross Boylan r...@biostat.ucsf.edu writes: Either git fetch origin master:refs/remotes/origin/master Great; that works. Is that procedure supposed to be the usual way I track upstream in this (1.7) version of git? It seems arcane. No, and no. The command is designed so that most of

Re: confused about remote branch management

2014-07-23 Thread Ross Boylan
On Wed, 2014-07-23 at 16:51 -0700, Junio C Hamano wrote: Ross Boylan r...@biostat.ucsf.edu writes: Either git fetch origin master:refs/remotes/origin/master Great; that works. Is that procedure supposed to be the usual way I track upstream in this (1.7) version of git? It seems

[PATCH 0/5] coverity mixed bag

2014-07-23 Thread Jeff King
Since Stefan has recently started feeding git builds to coverity, I spent a few minutes poking through the results. There are tons of false positives, so there is some work to be done there with tweaking our coverity models. But there are some real issues, too. Here are fixes for the handful that

[PATCH 1/5] receive-pack: don't copy dir parameter

2014-07-23 Thread Jeff King
We used to do this so could pass a mutable string to enter_repo. But since 1c64b48 (enter_repo: do not modify input, 2011-10-04), this is not necessary. The resulting code is simpler, and it fixes a minor leak. Signed-off-by: Jeff King p...@peff.net --- If you are wondering whether upload-pack

[PATCH 2/5] free ref string returned by dwim_ref

2014-07-23 Thread Jeff King
A call to dwim_ref(name, len, flags, ref) will allocate a new string in ref to return the exact ref we found. We do not consistently free it in all code paths, leading to small leaks. The worst is in get_sha1_basic, which may be called many times (e.g., by cat-file --batch), though it is

[PATCH 3/5] transport: fix leaks in refs_from_alternate_cb

2014-07-23 Thread Jeff King
The function starts by creating a copy of the static buffer returned by real_path, but forgets to free it in the error code paths. We can solve this by jumping to the cleanup code that is already there. Signed-off-by: Jeff King p...@peff.net --- transport.c | 5 +++-- 1 file changed, 3

[PATCH 4/5] fix memory leak parsing core.commentchar

2014-07-23 Thread Jeff King
When we see the core.commentchar config option, we extract the string with git_config_string, which does two things: 1. It complains via config_error_nonbool if there is no string value. 2. It makes a copy of the string. Since we immediately parse the string into its single-character

[PATCH 5/5] apply: avoid possible bogus pointer

2014-07-23 Thread Jeff King
When parsing index lines from a git-diff, we look for a space followed by the mode. If we don't have a space, then we set our pointer to the end-of-line. However, we don't double-check that our end-of-line pointer is valid (e.g., if we got a truncated diff input), which could lead to some