Re: Error pushing new branch: value too great for base (error token is...

2015-08-10 Thread Gaurav Chhabra
Thanks for the detailed explanation Eric! That really helped clear my doubts. Also tried with "0x" and it's working fine however, as suggested by you, i will use '=' Thanks again! :) On Tue, Aug 11, 2015 at 4:17 AM, Eric Sunshine wrote: > On Mon, Aug 10, 2015 at 6:29 PM, Jacob Keller wrote: >>

[PATCH v2 2/2] bisect: make bisection refs per-worktree

2015-08-10 Thread David Turner
Using the new refs/worktree/ refs, make bisection per-worktree. Signed-off-by: David Turner --- Documentation/git-bisect.txt | 4 ++-- Documentation/rev-list-options.txt | 14 +++--- bisect.c | 2 +- builtin/rev-parse.c| 6 -- revisi

[PATCH v2 1/2] refs: refs/worktree/* become per-worktree

2015-08-10 Thread David Turner
We need a place to stick refs for bisects in progress that is not shared between worktrees. So we use the refs/worktree/ hierarchy. The is_per_worktree_ref function and associated docs learn that refs/worktree/ is per-worktree, as does the git_path code in path.c The ref-packing functions learn

Re: [PATCH 04/17] add_to_alternates_file: don't add duplicate entries

2015-08-10 Thread Michael Haggerty
On 08/10/2015 11:34 AM, Jeff King wrote: > The add_to_alternates_file function blindly uses > hold_lock_file_for_append to copy the existing contents, and > then adds the new line to it. This has two minor problems: > > 1. We might add duplicate entries, which are ugly and > inefficient. >

Re: [PATCH v3] worktree: add 'list' command

2015-08-10 Thread David Turner
On Mon, 2015-08-10 at 16:53 -0400, Michael Rappazzo wrote: > + while ((d = readdir(dir)) != NULL) { I think it would be useful to break this loop out into a for_each_worktree function. While looking into per-worktree ref stuff, I have just noticed that git prune will delete ob

Re: [PATCH 04/10] branch: roll show_detached HEAD into regular ref_list

2015-08-10 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 9:01 AM, Karthik Nayak wrote: > Remove show_detached() and make detached HEAD to be rolled into > regular ref_list by adding REF_DETACHED_HEAD as a kind of branch and > supporting the same in append_ref(). This eliminates the need for an > extra function and helps in easier

Re: [PATCH 03/10] branch: bump get_head_description() to the top

2015-08-10 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 9:01 AM, Karthik Nayak wrote: > This is a preperatory patch for 'roll show_detached HEAD into regular > ref_list'. This patch moves get_head_descrition() to the top so that s/descrition/description/ > it can be used in print_ref_item(). > > Signed-off-by: Karthik Nayak --

Re: [PATCH 02/10] branch: refactor width computation

2015-08-10 Thread Eric Sunshine
On Tue, Aug 4, 2015 at 9:01 AM, Karthik Nayak wrote: > Remove unnecessary variables from ref_list and ref_item which were > used for width computation. This is to make ref_item similar to > ref-filter's ref_array_item. This will ensure a smooth port of > branch.c to use ref-filter APIs in further

Re: git blame breaking on repository with CRLF files

2015-08-10 Thread brian m. carlson
On Mon, Aug 10, 2015 at 08:36:35AM +, Benkstein, Frank wrote: > You are correct that it is also wrong in git v1.7.0. However, it is correct > in > v2.4.0. > > Another bisect gave me this commit which was included in v2.0.1: > > commit 4d4813a52f3722854a54bab046f4abfec13ef6ae > Author: bri

Re: [PATCH 10/17] path.c: drop git_path_submodule

2015-08-10 Thread Junio C Hamano
Junio C Hamano writes: > Junio C Hamano writes: > >> Jeff King writes: >> >>> There are no callers of the slightly-dangerous static-buffer >>> git_path_submodule left. Let's drop it. >> >> There are a few callers added on 'pu', though. > > Actually there is only one. Here is a proposed evil me

Re: [PATCH v2] send-email: provide whitelist of SMTP AUTH mechanisms

2015-08-10 Thread Eric Sunshine
On Mon, Aug 10, 2015 at 6:06 AM, Jan Viktorin wrote: > On Sun, 9 Aug 2015 14:13:33 -0400 > Eric Sunshine wrote: >> One possibility which comes to mind is to create a fake >> Authen::SASL::Perl which merely dumps its input mechanisms to a file, >> and arrange for the Perl search path to find the f

Re: [PATCH 10/17] path.c: drop git_path_submodule

2015-08-10 Thread Junio C Hamano
Junio C Hamano writes: > Jeff King writes: > >> There are no callers of the slightly-dangerous static-buffer >> git_path_submodule left. Let's drop it. > > There are a few callers added on 'pu', though. Actually there is only one. Here is a proposed evil merge. diff --git a/submodule.c b/subm

Re: [PATCH 10/17] path.c: drop git_path_submodule

2015-08-10 Thread Junio C Hamano
Jeff King writes: > There are no callers of the slightly-dangerous static-buffer > git_path_submodule left. Let's drop it. There are a few callers added on 'pu', though. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More m

Re: [PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread Eric Sunshine
On Mon, Aug 10, 2015 at 6:42 PM, David Turner wrote: > On Mon, 2015-08-10 at 18:30 -0400, Eric Sunshine wrote: >> On Mon, Aug 10, 2015 at 1:52 PM, David Turner >> wrote: >> > worktrees: add find_shared_symref >> >> s/worktrees/branch/ perhaps? > > Do you mean "this is in branch.c, so should be l

Re: Error pushing new branch: value too great for base (error token is...

2015-08-10 Thread Eric Sunshine
On Mon, Aug 10, 2015 at 6:29 PM, Jacob Keller wrote: > On Mon, Aug 10, 2015 at 2:54 AM, Gaurav Chhabra > wrote: >> Apologies for the delay in reply! I tried your suggestion and it >> works. Thanks! :) >> >> I'm curious why integer comparison is throwing error. Shouldn't i be >> comparing numbers

Re: [PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread David Turner
On Mon, 2015-08-10 at 18:30 -0400, Eric Sunshine wrote: > On Mon, Aug 10, 2015 at 1:52 PM, David Turner > wrote: > > worktrees: add find_shared_symref > > s/worktrees/branch/ perhaps? Do you mean "this is in branch.c, so should be labeled with branch"? Because this change is mostly about non

Re: [PATCH 05/17] remove hold_lock_file_for_append

2015-08-10 Thread Junio C Hamano
Jeff King writes: > No users of hold_lock_file_for_append remain, so remove it. This does not seem to have anything to do with rotating static buffers used in get_pathname(); the only effect it has is to conflict heavily with Michael's tempfile topic X-<. Perhaps this should be part of Michael'

Re: [PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread Eric Sunshine
On Mon, Aug 10, 2015 at 1:52 PM, David Turner wrote: > worktrees: add find_shared_symref s/worktrees/branch/ perhaps? > Add a new function, find_shared_symref, which contains the heart of > die_if_checked_out, but works for any symref, not just HEAD. Refactor > die_if_checked_out to use the sam

Re: Error pushing new branch: value too great for base (error token is...

2015-08-10 Thread Jacob Keller
On Mon, Aug 10, 2015 at 2:54 AM, Gaurav Chhabra wrote: > Apologies for the delay in reply! I tried your suggestion and it > works. Thanks! :) > > I'm curious why integer comparison is throwing error. Shouldn't i be > comparing numbers with numeric operator? > Yes, but shell doesn't treat hex numb

Re: [PATCH v3] worktree: add 'list' command

2015-08-10 Thread Junio C Hamano
Michael Rappazzo writes: > +static int list(int ac, const char **av, const char *prefix) > +{ > + int main_only = 0; > + struct option options[] = { > + OPT_BOOL(0, "main-only", &main_only, N_("only list the main > worktree")), > + OPT_END() > + }; Hmm, main-

[PATCH v3] worktree: add 'list' command

2015-08-10 Thread Michael Rappazzo
'git worktree list' will list the main worktree followed by any linked worktrees which were created using 'git worktree add'. Signed-off-by: Michael Rappazzo --- Documentation/git-worktree.txt | 6 +++- builtin/worktree.c | 67 ++ t/t2027-work

[PATCH v3] worktree: add 'list' command

2015-08-10 Thread Michael Rappazzo
Differences from [v2](http://www.mail-archive.com/git@vger.kernel.org/msg75467.html) - removed unintended whitespace changes - cleanup based on comments from v2 Michael Rappazzo (1): worktree: add 'list' command Documentation/git-worktree.txt | 6 +++- builtin/worktree.c |

Re: git blame breaking on repository with CRLF files

2015-08-10 Thread Torsten Bögershausen
On 2015-08-10 20.48, Junio C Hamano wrote: > Torsten Bögershausen writes: > >> Actually I could reproduce the following: >> CRLF in repo, CRLF in working tree, core.autocrlf= true. > > What should happen in such a case? Wouldn't autocrlf=true want to > strip CRLF down to LF? Shouldn't it? A

Re: [PATCH v5 0/4] submodule config lookup API

2015-08-10 Thread Stefan Beller
On Mon, Jun 15, 2015 at 2:48 PM, Junio C Hamano wrote: > Thanks. Will replace and wait for comments from others. I have reviewed the patches carefully and they look good to me. As Git is a large project and I was active in other parts until now, I noticed that there are subtle differences in st

Re

2015-08-10 Thread git-owner
Your Donation to you is ready, contact melc...@gmail.com for more details -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] config.mak.uname: Cygwin: Use renames for creation

2015-08-10 Thread Junio C Hamano
Adam Dinwoodie writes: > If the desired goal is that Cygwin's link(2) acts like POSIX link(2) > on network drives, I'm not convinced that's possible, at least not by > emulating `core.createObject = rename` in the Cygwin library > layer. The way core.createObject=rename makes things work is by a

Re: git blame breaking on repository with CRLF files

2015-08-10 Thread Junio C Hamano
Torsten Bögershausen writes: > Actually I could reproduce the following: > CRLF in repo, CRLF in working tree, core.autocrlf= true. What should happen in such a case? Wouldn't autocrlf=true want to strip CRLF down to LF? Shouldn't it? And if so, "blame" is correct to say that you are changing

Re: resolving a (possibly remote) branch HEAD to a hash

2015-08-10 Thread Junio C Hamano
per...@pluto.rain.com (Perry Hutchison) writes: >> ... we do not say "append 'refs/remotes//' for various >> values of and see if such a ref exists" when resolving >> an abbreviated refname 'master'. > > checkout appears to. You are referring to this part of the documentation: If is not fo

Re: Error when cloning with weird local directory

2015-08-10 Thread Junio C Hamano
Torsten Bögershausen writes: > So I think that git clone can be slighty more consistant here. Sure. >> I _think_ taking notice of "word://" (with doubled slashes) and >> treating it specially will not introduce any new issue; while it is >> still OK for users to have a local directory called "w

Re: [PATCH v5 0/5] Improve guessing of repository names

2015-08-10 Thread Junio C Hamano
Patrick Steinhardt writes: > This is version 5 of my patch series which aims to improve > guessed directory names in several cases. > > This version now includes the patches from Jeff which were > previously a separate patch series. Besides fixing behavior when > cloning a repository with trailin

[PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread David Turner
Add a new function, find_shared_symref, which contains the heart of die_if_checked_out, but works for any symref, not just HEAD. Refactor die_if_checked_out to use the same infrastructure as find_shared_symref. Soon, we will use find_shared_symref to protect notes merges in worktrees. Signed-off

[PATCH v6 2/2] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- builtin/notes.c | 6 t/t3320-notes-merge-worktrees.

Re: [PATCH v6] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Sorry, that should have included the first patch as well. Will re-send as .v7 On Mon, 2015-08-10 at 13:43 -0400, David Turner wrote: > Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using > find_shared_symref and die if we find one. This prevents simultaneous > merges to the same notes b

Re: [PATCH 0/17] removing questionable uses of git_path

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 10:31:32AM -0700, Junio C Hamano wrote: > Jeff King writes: > > > The problem is that git_path uses a static buffer that gets overwritten > > by subsequent calls. > > As the rotating static buffer pattern used in get_pathname() was > modeled after sha1_to_hex(), we have

[PATCH v6] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- This reroll addresses Eric Sunshine's comments on v5. --- builtin/notes.

Re: [PATCH] sha1_file.c: rename move_temp_to_file() to finalize_temp_file()

2015-08-10 Thread Junio C Hamano
Jeff King writes: > On Fri, Aug 07, 2015 at 05:24:29PM -0700, Junio C Hamano wrote: > >> Since 5a688fe4 ("core.sharedrepository = 0mode" should set, not >> loosen, 2009-03-25), we kept reminding ourselves: >> >> NEEDSWORK: this should be renamed to finalize_temp_file() as >> "moving" is

Re: [PATCH 0/17] removing questionable uses of git_path

2015-08-10 Thread Junio C Hamano
Jeff King writes: > The problem is that git_path uses a static buffer that gets overwritten > by subsequent calls. As the rotating static buffer pattern used in get_pathname() was modeled after sha1_to_hex(), we have the same issue there. They are troubles waiting to happen unless the callers a

Re: [PATCH 2/2] pager_in_use: make sure output is still going to pager

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 06:38:10PM +0200, Johannes Schindelin wrote: > > +const char *pipe_id_get(int fd) > > +{ > > + static struct strbuf id = STRBUF_INIT; > > + struct stat st; > > + > > + if (fstat(fd, &st) < 0 || !S_ISFIFO(st.st_mode)) > > + return NULL; > > Just a quick note

Re: [PATCHv3 1/2] config: add '--names-only' option to list only variable names

2015-08-10 Thread Junio C Hamano
SZEDER Gábor writes: > 'git config' can only show values or name-value pairs, so if a shell > script needs the names of set config variables it has to run 'git config > --list' or '--get-regexp' and parse the output to separate config > variable names from their values. However, such a parsing c

RE: File Hash for Windows executable

2015-08-10 Thread Kiser, Ryan Lee
Ah, perfect. Thank you. I was looking at 1.9.5 from http://www.git-scm.com/download Thanks for pointing me at the right place. -Ryan -Original Message- From: Johannes Schindelin [mailto:johannes.schinde...@gmx.de] Sent: Monday, August 10, 2015 12:10 PM To: Kiser, Ryan Lee Cc: git@vger

Re: [PATCH] submodule: implement `module_name` as a builtin helper

2015-08-10 Thread Stefan Beller
On Fri, Aug 7, 2015 at 11:20 PM, Junio C Hamano wrote: > Junio C Hamano writes: > ... if you really want to go the "thread" route, the first thing to try would be to see if a few places we already use threads for parallelism (namely, "grep", "pack-objects", "preload-index" and

Re: [PATCH 2/2] pager_in_use: make sure output is still going to pager

2015-08-10 Thread Johannes Schindelin
Hi Peff, On 2015-08-10 07:23, Jeff King wrote: > diff --git a/compat/pipe-id.c b/compat/pipe-id.c > new file mode 100644 > index 000..4764c5f > --- /dev/null > +++ b/compat/pipe-id.c > @@ -0,0 +1,25 @@ > +#include "git-compat-util.h" > +#include "compat/pipe-id.h" > +#include "strbuf.h" > + >

Re: File Hash for Windows executable

2015-08-10 Thread Johannes Schindelin
Hi Ryan, On 2015-08-10 15:54, Kiser, Ryan Lee wrote: > I've downloaded the Windows installer for Git, Which one. > but can't seem to find hashes published anywhere for verification. Since the > downloaded file doesn't seem to be signed, The newest ones from https://git-for-windows.github.io/

[PATCH v5 3/5] clone: do not include authentication data in guessed dir

2015-08-10 Thread Patrick Steinhardt
If the URI contains authentication data and the URI's path component is empty we fail to guess a sensible directory name. E.g. cloning a repository 'ssh://user:passw...@example.com/' we guess a directory name 'passw...@example.com' where we would want the hostname only, e.g. 'example.com'. The nai

[PATCH v5 4/5] clone: do not use port number as dir name

2015-08-10 Thread Patrick Steinhardt
If the URI contains a port number and the URI's path component is empty we fail to guess a sensible directory name. E.g. cloning a repository 'ssh://example.com:/' we guess a directory name '' where we would want the hostname only, e.g. 'example.com'. We need to take care to not drop trail

[PATCH v5 2/5] clone: use computed length in guess_dir_name

2015-08-10 Thread Patrick Steinhardt
From: Jeff King Commit 7e837c6 (clone: simplify string handling in guess_dir_name(), 2015-07-09) changed clone to use strip_suffix instead of hand-rolled pointer manipulation. However, strip_suffix will strip from the end of a NUL-terminated string, and we may have already stripped some character

[PATCH v5 0/5] Improve guessing of repository names

2015-08-10 Thread Patrick Steinhardt
This is version 5 of my patch series which aims to improve guessed directory names in several cases. This version now includes the patches from Jeff which were previously a separate patch series. Besides fixing behavior when cloning a repository with trailing '.git' suffix they also add a new test

[PATCH v5 1/5] clone: add tests for output directory

2015-08-10 Thread Patrick Steinhardt
From: Jeff King When we run "git clone $url", clone guesses from the $url what to name the local output directory. We don't have any test coverage of this, so let's add some basic tests. This reveals a few problems: - cloning "foo.git/" does not properly remove the ".git"; this is a recen

[PATCH v5 5/5] clone: abort if no dir name could be guessed

2015-08-10 Thread Patrick Steinhardt
Due to various components of the URI being stripped off it may happen that we fail to guess a directory name. We currently error out with a message that it is impossible to create the working tree '' in such cases. Instead, error out early with a sensible error message hinting that a directory name

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Ed Avis
Junio C Hamano pobox.com> writes: >>Yes, my use case is that I get confused about whether the stash has been >>dropped or not and whether I might have stashed something else in the >>meantime. So for me plain 'git stash drop' feels a bit dangerous. > >Then "git stash apply" followed by "git sta

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Junio C Hamano
Ed Avis writes: > Yes, my use case is that I get confused about whether the stash has been > dropped or not and whether I might have stashed something else in the > meantime. So for me plain 'git stash drop' feels a bit dangerous. Then "git stash apply" followed by "git stash drop" would be a p

File Hash for Windows executable

2015-08-10 Thread Kiser, Ryan Lee
Hello, I've downloaded the Windows installer for Git, but can't seem to find hashes published anywhere for verification. Since the downloaded file doesn't seem to be signed, I'll need another way to verify it's integrity before running it on my system. Are hashes published somewhere that I'm m

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Ed Avis
> Yes, my use case is that I get confused about whether the stash has been dropped or not and whether I might have stashed something else in the meantime. So for me plain 'git stash drop' feels a bit dangerous. Jeff King peff.net> writes: >I also wondered if the "dropped" message is >sufficient

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 01:43:07PM +, Ed Avis wrote: > Jeff King peff.net> writes: > > >>An alternative would be for git stash to always print the name of the stash > >>it is applying. > > > Applying refs/stash@{0} (31cb86c3d700d241e315d989f460e3e83f84fa19) > > Yes, that's the one. > > >

Re: [PATCHv3 2/2] completion: list variable names reliably with 'git config --names-only'

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 11:46:07AM +0200, SZEDER Gábor wrote: > Use the new '--names-only' option added in the previous commit to list > config variable names reliably in both cases, without error-prone post > processing. > > Signed-off-by: SZEDER Gábor This looks like a pretty straight-forward

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Ed Avis
Jeff King peff.net> writes: >>An alternative would be for git stash to always print the name of the stash >>it is applying. > Applying refs/stash@{0} (31cb86c3d700d241e315d989f460e3e83f84fa19) Yes, that's the one. >Or maybe it would be useful to actually show the stash subject, That could be

Re: [PATCHv3 1/2] config: add '--names-only' option to list only variable names

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 11:46:06AM +0200, SZEDER Gábor wrote: > 'git config' can only show values or name-value pairs, so if a shell > script needs the names of set config variables it has to run 'git config > --list' or '--get-regexp' and parse the output to separate config > variable names from

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 12:50:51PM +, Ed Avis wrote: > An alternative would be for git stash to always print the name of the stash > it is applying. Then you can drop it afterwards by name and be sure you got > the right one. Printing the name of the stash sounds like a reasonable > bit of c

Re: Bug report Windows 10

2015-08-10 Thread Johannes Schindelin
Hi, On 2015-08-10 14:26, MS-Informatique wrote: > My Windows notebook got updated to Windows 10 and now my Git Bash doesn't > start and when I open an existing repository from Git Gui, I am getting next > error: > "0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487 > Allocati

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Ed Avis
An alternative would be for git stash to always print the name of the stash it is applying. Then you can drop it afterwards by name and be sure you got the right one. Printing the name of the stash sounds like a reasonable bit of chatter to add anyway, do you agree? -- Ed Avis -- To unsubscri

Re: Feature: git stash pop --always-drop

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 10:42:30AM +, Ed Avis wrote: > I would find it useful to ask 'git stash pop' to always drop the stash after > applying it to the working tree, even if there were conflicts. (Only if there > was some hard error, such as an I/O error updating some of the files, should >

Re: Bug report Windows 10

2015-08-10 Thread Konstantin Khomoutov
On Mon, 10 Aug 2015 14:26:44 +0200 "MS-Informatique" wrote: > My Windows notebook got updated to Windows 10 and now my Git Bash > doesn't start and when I open an existing repository from Git Gui, I > am getting next error: > "0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error >

Re: [PATCH 17/17] memoize common git-path "constant" files

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 02:05:14PM +0200, Michael Haggerty wrote: > I was wondering whether this memoization could interact badly with > update_common_dir(). For example, if any of the memoized functions were > called before git_common_dir is initialized, then the pre-git_common_dir > value would

Bug report Windows 10

2015-08-10 Thread MS-Informatique
My Windows notebook got updated to Windows 10 and now my Git Bash doesn't start and when I open an existing repository from Git Gui, I am getting next error: "0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487 AllocationBase 0x0, BaseAddress 0x6857, RegionSize 0x41, St

Re: [PATCH 11/17] refs.c: simplify strbufs in reflog setup and writing

2015-08-10 Thread Jeff King
On Mon, Aug 10, 2015 at 12:34:05PM +0200, Michael Haggerty wrote: > How about taking this opportunity to name the parameters ("logfile" vs. > "log_file") consistently? Thanks, that's a good suggestion. Here's a re-roll of this patch: -- >8 -- Subject: [PATCH] refs.c: simplify strbufs in reflog s

Re: [PATCH 0/17] removing questionable uses of git_path

2015-08-10 Thread Michael Haggerty
On 08/10/2015 11:27 AM, Jeff King wrote: > [...] The problem is that git_path uses a static buffer that gets overwritten > by subsequent calls. [...] > > [01/17]: cache.h: clarify documentation for git_path, et al > [02/17]: cache.h: complete set of git_path_submodule helpers > [03/17]: t570

Re: [PATCH 17/17] memoize common git-path "constant" files

2015-08-10 Thread Michael Haggerty
On 08/10/2015 11:38 AM, Jeff King wrote: > [...] > This patch introduces a series of functions to "memoize" > these strings, which are essentially globals for the > lifetime of the program. We compute the value once, take > ownership of the buffer, and return the cached value for > subsequent calls

Feature: git stash pop --always-drop

2015-08-10 Thread Ed Avis
I would find it useful to ask 'git stash pop' to always drop the stash after applying it to the working tree, even if there were conflicts. (Only if there was some hard error, such as an I/O error updating some of the files, should the stash be left on the stack.) Would a patch for such an --alwa

Re: [PATCH 11/17] refs.c: simplify strbufs in reflog setup and writing

2015-08-10 Thread Michael Haggerty
On 08/10/2015 11:36 AM, Jeff King wrote: > Commit 1a83c24 (git_snpath(): retire and replace with > strbuf_git_path(), 2014-11-30) taught log_ref_setup and > log_ref_write_1 to take a strbuf parameter, rather than a > bare string. It then makes an alias to the strbuf's "buf" > field under the origin

Re: [PATCH v2] send-email: provide whitelist of SMTP AUTH mechanisms

2015-08-10 Thread Jan Viktorin
On Sun, 9 Aug 2015 14:13:33 -0400 Eric Sunshine wrote: > On Wed, Aug 5, 2015 at 3:17 AM, Jan Viktorin > wrote: > > Do I understand well that you are complaining about too > > narrow commmit message? > > Yes, I'm a complainer. ;-) It's minor, though, not a big deal, and > certainly not worth a r

Re: Error pushing new branch: value too great for base (error token is...

2015-08-10 Thread Gaurav Chhabra
Apologies for the delay in reply! I tried your suggestion and it works. Thanks! :) I'm curious why integer comparison is throwing error. Shouldn't i be comparing numbers with numeric operator? On Mon, Aug 10, 2015 at 3:23 PM, Gaurav Chhabra wrote: > Apologies for the delay in reply! I tried your

[PATCH v2 13/16] lock_repo_for_gc(): compute the path to "gc.pid" only once

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 36fe333..c41354b 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -199,6 +199,7 @@ static const char *lock_repo_for_gc(int force, pid_t*

[PATCH v2 04/16] lockfile: add accessor get_lock_file_path()

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/commit.c | 15 --- config.c | 14 +++--- lockfile.c | 7 +++ lockfile.h | 6 ++ refs.c | 6 +++--- shallow.c| 6 +++--- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git

[PATCH v2 11/16] setup_temporary_shallow(): use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- shallow.c | 35 +++ 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/shallow.c b/shallow.c index 7973e74..2ba29a5 100644 --- a/shallow.c +++ b/shallow.c @@ -1,4 +1,5 @@ #include "cache.h" +#include "tempfile.h" #i

[PATCH v2 14/16] gc: use tempfile module to handle gc.pid file

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index c41354b..bfe589f 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -11,6 +11,7 @@ */ #include "builtin.h" +#include

[PATCH v2 05/16] commit_lock_file(): use get_locked_file_path()

2015-08-10 Thread Michael Haggerty
First beef up the sanity checking in get_locked_file_path() to match that in commit_lock_file(). Then rewrite commit_lock_file() to use get_locked_file_path() for its pathname computation. Signed-off-by: Michael Haggerty --- lockfile.c | 28 1 file changed, 12 insert

[PATCH v2 01/16] Move lockfile documentation to lockfile.h and lockfile.c

2015-08-10 Thread Michael Haggerty
Rearrange/rewrite it somewhat to fit its new environment. Signed-off-by: Michael Haggerty --- Documentation/technical/api-lockfile.txt | 220 --- lockfile.c | 53 ++ lockfile.h | 290

[PATCH v2 10/16] write_shared_index(): use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- read-cache.c | 38 ++ 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/read-cache.c b/read-cache.c index 96cb9a3..89be226 100644 --- a/read-cache.c +++ b/read-cache.c @@ -5,6 +5,7 @@ */ #define NO_THE_INDEX_C

[PATCH v2 09/16] register_tempfile(): new function to handle an existing temporary file

2015-08-10 Thread Michael Haggerty
Allow an existing file to be registered with the tempfile-handling infrastructure; in particular, arrange for it to be deleted on program exit. This can be used if the temporary file has to be created in a more complicated way than just open(). For example: * If the file itself needs to be created

[PATCH v2 07/16] prepare_tempfile_object(): new function, extracted from create_tempfile()

2015-08-10 Thread Michael Haggerty
This makes the next step easier. The old code used to use "path" to set the initial length of tempfile->filename. This was not helpful because path was usually relative whereas the value stored to filename will be absolute. So just initialize the length to 0. Signed-off-by: Michael Haggerty ---

[PATCH v2 03/16] lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()

2015-08-10 Thread Michael Haggerty
We are about to move those members, so change client code to read them through accessor functions. Signed-off-by: Michael Haggerty --- credential-store.c | 2 +- lockfile.c | 14 ++ lockfile.h | 3 +++ read-cache.c | 2 +- refs.c | 12 +++-

[PATCH v2 08/16] tempfile: add several functions for creating temporary files

2015-08-10 Thread Michael Haggerty
Add several functions for creating temporary files with automatically-generated names, analogous to mkstemps(), but also arranging for the files to be deleted on program exit. The functions are named according to a pattern depending how they operate. They will be used to replace many places in the

[PATCH v2 16/16] credential-cache--daemon: use tempfile module

2015-08-10 Thread Michael Haggerty
Use the tempfile module to ensure that the socket file gets deleted on program exit. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache--daemo

[PATCH v2 12/16] diff: use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- diff.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/diff.c b/diff.c index 7500c55..dc95247 100644 --- a/diff.c +++ b/diff.c @@ -2,6 +2,7 @@ * Copyright (C) 2005 Junio C Hamano */ #include "cache.h" +#in

[PATCH v2 06/16] tempfile: a new module for handling temporary files

2015-08-10 Thread Michael Haggerty
A lot of work went into defining the state diagram for lockfiles and ensuring correct, race-resistant cleanup in all circumstances. Most of that infrastructure can be applied directly to *any* temporary file. So extract a new "tempfile" module from the "lockfile" module. Reimplement lockfile on to

[PATCH v2 02/16] create_bundle(): duplicate file descriptor to avoid closing it twice

2015-08-10 Thread Michael Haggerty
write_pack_data() passes bundle_fd to start_command() to be used as the stdout of pack-objects. But start_command() closes its stdout if it is > 1. This is a problem if bundle_fd is the fd of a lock_file, because commit_lock_file() will also try to close the fd. So the old code suppressed commit_l

[PATCH v2 15/16] credential-cache--daemon: delete socket from main()

2015-08-10 Thread Michael Haggerty
main() is responsible for cleaning up the socket in the case of errors, so it is reasonable to also make it responsible for cleaning it up when there are no errors. This change also makes the next step easier. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 3 ++- 1 file changed

[PATCH v2 00/16] Introduce a tempfile module

2015-08-10 Thread Michael Haggerty
This is a re-roll of the tempfile patch series [1]. I'm sorry for the long delay getting v2 out. Thanks to Junio and Johannes Sixt for their feedback about v1. I think I have addressed all of their points. This version is very similar to v1 in spirit, though quite a few details have changed. The m

[PATCHv3 2/2] completion: list variable names reliably with 'git config --names-only'

2015-08-10 Thread SZEDER Gábor
Recenty I created a multi-line branch description with '.' and '=' characters on one of the lines, and noticed that fragments of that line show up when completing set variable names for 'git config', e.g.: $ git config --get branch.b.description Branch description to fool the completion script

[PATCHv3 0/2] 'git config --names-only' to help the completion script

2015-08-10 Thread SZEDER Gábor
This is a reroll of 'sg/config-name-only'. * Instead of the two new listing options of the previous round add one new option '--names-only' to modify the output of '--list' and '--get-regexp' options, as suggested in previous discussions. * Reorganized the commit messages: don't go int

[PATCHv3 1/2] config: add '--names-only' option to list only variable names

2015-08-10 Thread SZEDER Gábor
'git config' can only show values or name-value pairs, so if a shell script needs the names of set config variables it has to run 'git config --list' or '--get-regexp' and parse the output to separate config variable names from their values. However, such a parsing can't cope with multi-line value

[PATCH 17/17] memoize common git-path "constant" files

2015-08-10 Thread Jeff King
One of the most common uses of git_path() is to pass a constant, like git_path("MERGE_MSG"). This has two drawbacks: 1. The return value is a static buffer, and the lifetime is dependent on other calls to git_path, etc. 2. There's no compile-time checking of the pathname. This is OK

[PATCH 16/17] get_repo_path: refactor path-allocation

2015-08-10 Thread Jeff King
The get_repo_path function calls mkpath() and then does some non-trivial operations on it, like calling is_git_directory() and read_gitfile(). These are actually OK (they do not use more pathname static buffers themselves), but it takes a fair bit of work to verify. Let's use our own strbuf to sto

[PATCH 15/17] find_hook: keep our own static buffer

2015-08-10 Thread Jeff King
The find_hook function returns the results of git_path, which is a static buffer shared by other path-related calls. Returning such a buffer is slightly dangerous, because it can be overwritten by seemingly unrelated functions. Let's at least keep our _own_ static buffer, so you can only get in tr

[PATCH 12/17] refs.c: avoid repeated git_path calls in rename_tmp_log

2015-08-10 Thread Jeff King
Because it's not safe to store the static-buffer results of git_path for a long time, we end up formatting the same filename over and over. We can fix this by using a function-local strbuf to store the formatted pathname and avoid repeating ourselves. Signed-off-by: Jeff King --- refs.c | 21 +++

[PATCH 13/17] refs.c: avoid git_path assignment in lock_ref_sha1_basic

2015-08-10 Thread Jeff King
Assigning the result of git_path is a bad pattern, because it's not immediately obvious how long you expect the content to stay valid (and it may be overwritten by subsequent calls). Let's use a function-local strbuf here instead, which we know is safe (we just have to remember to free it in all co

[PATCH 14/17] refs.c: remove_empty_directories can take a strbuf

2015-08-10 Thread Jeff King
The first thing we do in this function is copy the input into a strbuf. Of the 4 callers, 3 of them already have a strbuf we could use. Let's just take the strbuf, and convert the remaining caller to use a strbuf, rather than a raw git_path. This is safer, anyway, as remove_dir_recursively is a non

[PATCH 10/17] path.c: drop git_path_submodule

2015-08-10 Thread Jeff King
There are no callers of the slightly-dangerous static-buffer git_path_submodule left. Let's drop it. Signed-off-by: Jeff King --- cache.h | 5 ++--- path.c | 10 -- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cache.h b/cache.h index 6f74f33..7a4fa90 100644 --- a/cac

[PATCH 11/17] refs.c: simplify strbufs in reflog setup and writing

2015-08-10 Thread Jeff King
Commit 1a83c24 (git_snpath(): retire and replace with strbuf_git_path(), 2014-11-30) taught log_ref_setup and log_ref_write_1 to take a strbuf parameter, rather than a bare string. It then makes an alias to the strbuf's "buf" field under the original name. This made the original diff much shorter,

[PATCH 09/17] refs.c: remove extra git_path calls from read_loose_refs

2015-08-10 Thread Jeff King
In iterating over the loose refs in "refs/foo/", we keep a running strbuf with "refs/foo/one", "refs/foo/two", etc. But we also need to access these files in the filesystem, as ".git/refs/foo/one", etc. For this latter purpose, we make a series of independent calls to git_path(). These are safe (we

  1   2   >