On Sat, Jan 07, 2017 at 08:28:22AM +0100, Johannes Sixt wrote:
> > But when you have a dashed external (or an alias pointing to
> > a builtin, which will re-exec git for the builtin), there's
> > an extra process in the mix. For instance, running:
> >
> > git -c alias.l=log log
>
> This
Am 07.01.2017 um 02:22 schrieb Jeff King:
When you hit ^C to interrupt a git command going to a pager,
this usually leaves the pager running. But when a dashed
external is in use, the pager ends up in a funny state and
quits (but only after eating one more character from the
terminal!). This
On Fri, Jan 06, 2017 at 04:52:16PM +0100, Michael Haggerty wrote:
> I just released `git test`, a script for running automated
> tests across a range of Git commits and keeping track of the results in
> git notes:
>
> https://github.com/mhagger/git-test
>
> This is a script that
On 2017-01-06 04:42, Johannes Sixt wrote:
Am 06.01.2017 um 02:09 schrieb Richard Hansen:
If rerere is enabled and no pathnames are given, run cd_to_toplevel
before running 'git diff --name-only' so that 'git diff --name-only'
sees the pathnames emitted by 'git rerere remaining'.
Also run
On 2017-01-05 20:31, Stefan Beller wrote:
On Thu, Jan 5, 2017 at 5:09 PM, Richard Hansen wrote:
Reduce how much a test can interfere other tests:
A bullet point list as an unordered list often indicates that you're
doing multiple
things at once, possibly unrelated, so
On Fri, Jan 06, 2017 at 01:03:29PM -0800, Stefan Beller wrote:
> +static int remove_workingtree_files(struct unpack_trees_options *o,
> + struct progress *progress)
> +{
> + int i;
> + unsigned cnt = 0;
> + struct index_state *index = >result;
> +
> +
On Fri, Jan 06, 2017 at 08:19:53PM -0500, Kyle Meyer wrote:
> > The other option is just "git checkout --detach", which is also used in
> > the test suite. I tend to prefer it because it's a little more obvious
> > to a reader.
>
> True, that does seem clearer. Seems I should've waited a bit
When you hit ^C to interrupt a git command going to a pager,
this usually leaves the pager running. But when a dashed
external is in use, the pager ends up in a funny state and
quits (but only after eating one more character from the
terminal!). This fixes it.
Explaining the reason will require a
Jeff King writes:
> On Fri, Jan 06, 2017 at 08:09:32PM -0500, Kyle Meyer wrote:
>
>> > $ git grep -c HEAD^{} junio/pu -- t/
>> > junio/pu:t/t3200-branch.sh:3
>> >
>> > Maybe use HEAD^0 just for consistency?
>>
>> Yes, thanks for pointing that out.
>
> The other option is just "git
When we try to exec a git sub-command, we pass along the
status code from run_command(). But that may return -1 if we
ran into an error with pipe() or execve(). This tends to
work (and end up as 255 due to twos-complement wraparound
and truncation), but in general it's probably a good idea to
When we run a dashed external, we use the one-liner
run_command_v_opt() to do so. Let's switch to using a
child_process struct, which has two advantages:
1. We can drop all of the allocation and cleanup code for
building our custom argv array, and just rely on the
builtin argv_array
On Fri, Jan 06, 2017 at 06:20:42PM -0500, Jeff King wrote:
> > In general, I think it is wrong to wait for child processes when a signal
> > was received. After all, it is the purpose of a (deadly) signal to have the
> > process go away. There may be programs that know it better, like less, but
>
Move the detached HEAD check from branch_get_push_1() to
branch_get_push() to avoid setting branch->push_tracking_ref when
branch is NULL.
Signed-off-by: Kyle Meyer
---
remote.c | 6 +++---
t/t1514-rev-parse-push.sh | 6 ++
2 files changed, 9 insertions(+),
On Fri, Jan 06, 2017 at 08:09:32PM -0500, Kyle Meyer wrote:
> > $ git grep -c HEAD^{} junio/pu -- t/
> > junio/pu:t/t3200-branch.sh:3
> >
> > Maybe use HEAD^0 just for consistency?
>
> Yes, thanks for pointing that out.
The other option is just "git checkout --detach", which is also used in
the
Johannes Schindelin writes:
[...]
>> +test_expect_success 'resolving @{push} fails with a detached HEAD' '
>> +git checkout HEAD^{} &&
>
> I seem to recall that we prefer HEAD^0 over HEAD^{} and the existing
> scripts seem to agree with me:
>
> $ git grep -c
On Fri, Jan 6, 2017 at 4:55 PM, David Turner wrote:
> (for the test)
> Signed-off-by: David Turner
>
> TIL: super-prefix!
yeah that was introduced recently for prefixes from "outside the repository"
e.g. a superproject, its first user is grep
(for the test)
Signed-off-by: David Turner
TIL: super-prefix!
On Fri, 2017-01-06 at 16:19 -0800, Stefan Beller wrote:
> In the submodule helper we did not correctly handled the display path
> for initializing submodules when both the submodule is inside a
> subdirectory
In the submodule helper we did not correctly handled the display path
for initializing submodules when both the submodule is inside a
subdirectory as well as the command being invoked from a subdirectory
(as viewed from the superproject).
This was broken in 3604242f080, which was written at a
On Fri, Jan 06, 2017 at 11:42:25PM +0100, Johannes Sixt wrote:
> > So I dunno. Maybe this waiting should be restricted only to certain
> > cases like executing git sub-commands.
>
> If given it some thought.
>
> In general, I think it is wrong to wait for child processes when a signal
> was
Am 06.01.2017 um 20:41 schrieb Jeff King:
On Fri, Jan 06, 2017 at 03:39:59PM +0100, Johannes Sixt wrote:
diff --git a/run-command.c b/run-command.c
index ca905a9e80..db47c429b7 100644
--- a/run-command.c
+++ b/run-command.c
@@ -29,6 +29,8 @@ static int installed_child_cleanup_handler;
static
Hello,
I was doing development on a linux box on AWS, when we found a code
bug that had me switching to running the code on a Mac instead. We
discovered that we had accidentally named two files the same when
looked at case-insensitively, which made git commands afterwards
display the wrong thing.
I believe (from bisection) that this was introduced in the transition to
C at 3604242f080.
I've attached a repro (against master). At the time the bug was
introduced, the output in question went to stdout instead of stderr, so
the attached test case will not quite work on the older version. But
From: "Robert Dailey"
Here's the scenario:
I create a topic branch so one other developer and myself can work on
a feature that takes 2 weeks to complete. During that 2 week period,
changes are occurring on master that I need in my topic branch. Since
I have a
The continue is the last statement in the loop, so not needed.
This situation arose in 700e66d66 (2010-07-30, unpack-trees: let
read-tree -u remove index entries outside sparse area) when statements
after the continue were removed.
Signed-off-by: Stefan Beller
---
This makes check_updates shorter and easier to understand.
Signed-off-by: Stefan Beller
---
unpack-trees.c | 32
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index f16ef14294..971d091fd0
This makes check_updates shorter and easier to understand.
Signed-off-by: Stefan Beller
---
unpack-trees.c | 29 +
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index 971d091fd0..b954ec1233 100644
This makes check_updates shorter and easier to understand.
Signed-off-by: Stefan Beller
---
unpack-trees.c | 40 ++--
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index
On Sat, Dec 31, 2016 at 5:26 PM, Junio C Hamano wrote:
>> Signed-off-by: Stefan Beller
>> ---
>
> I'd add René's Reviewed-by: here.
done
>
> I think moving heavier and initialized variables earlier and more
> lightweight and ephemeral ones like "i" later
The checkout state was introduced via 16da134b1f9
(read-trees: refactor the unpack_trees() part, 2006-07-30). An attempt to
refactor the checkout state was done in b56aa5b268e (unpack-trees: pass
checkout state explicitly to check_updates(), 2016-09-13), but we can
go even further.
The `struct
unpack-trees is a central file needed for the understanding
of working tree manipulation. To help with the understanding
refactor the code to be more readable.
The first patch was a standalone patch 8 days ago;
now incorporated into this series as a v3,
reducing the scope of the checkout state.
On Fri, Jan 06, 2017 at 11:43:52AM -0800, Stefan Beller wrote:
> >>> When executing "git branch --edit-description" on a branch with
> >>> no description set, I get "fatal: could not unset
> >>> 'branch..description". It would seem that the unsetting piece
> >>> should occur only after
2017-01-06 20:43 GMT+01:00 Stefan Beller :
> On Fri, Jan 6, 2017 at 11:31 AM, Ralf Thielow wrote:
>> 2017-01-06 18:55 GMT+01:00 Stefan Beller :
>>> On Fri, Jan 6, 2017 at 9:25 AM, Jake Lambert wrote:
Hello,
On Fri, Jan 06, 2017 at 05:22:20PM +0100, Michael Haggerty wrote:
> This is v4 of this patch series. Thanks to Peff, Junio, Jake, and
> Philip for their feedback about v3. I believe I have addressed all of
> the comments about v1 [1], v2 [2], and v3 [3].
This version looks good to me.
-Peff
On Fri, Jan 6, 2017 at 11:31 AM, Ralf Thielow wrote:
> 2017-01-06 18:55 GMT+01:00 Stefan Beller :
>> On Fri, Jan 6, 2017 at 9:25 AM, Jake Lambert wrote:
>>> Hello,
>>>
>>> When executing "git branch --edit-description" on a branch
On Fri, Jan 06, 2017 at 03:39:59PM +0100, Johannes Sixt wrote:
> > diff --git a/run-command.c b/run-command.c
> > index ca905a9e80..db47c429b7 100644
> > --- a/run-command.c
> > +++ b/run-command.c
> > @@ -29,6 +29,8 @@ static int installed_child_cleanup_handler;
> >
> > static void
2017-01-06 18:55 GMT+01:00 Stefan Beller :
> On Fri, Jan 6, 2017 at 9:25 AM, Jake Lambert wrote:
>> Hello,
>>
>> When executing "git branch --edit-description" on a branch with no
>> description set, I get "fatal: could not unset
>> 'branch..description".
Here's the scenario:
I create a topic branch so one other developer and myself can work on
a feature that takes 2 weeks to complete. During that 2 week period,
changes are occurring on master that I need in my topic branch. Since
I have a collaborator on the branch, I opt for merges instead of
On Fri, Jan 6, 2017 at 9:25 AM, Jake Lambert wrote:
> Hello,
>
> When executing "git branch --edit-description" on a branch with no
> description set, I get "fatal: could not unset 'branch..description".
> It would seem that the unsetting piece should occur only after checking
Hello,
When executing "git branch --edit-description" on a branch with no
description set, I get "fatal: could not unset 'branch..description".
It would seem that the unsetting piece should occur only after checking if it
was set in the first place. I am not too familiar with the inner
It's unnecessary to pass a strbuf holding the reflog path up and down
the call stack now that it is hardly needed by the callers. Remove the
places where log_ref_write_1() uses it, in preparation for making it
internal to log_ref_setup().
Signed-off-by: Michael Haggerty
---
Now files_log_ref_write() doesn't do anything beyond call
log_ref_write_1(), so inline the latter into the former.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 13 +++--
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git
Add a function that tries to create a file and any containing
directories in a way that is robust against races with other processes
that might be cleaning up empty directories at the same time.
The actual file creation is done by a callback function, which, if it
fails, should set errno to
Some implementations of free() change errno (even thought they
shouldn't):
https://sourceware.org/bugzilla/show_bug.cgi?id=17924
So preserve the errno from safe_create_leading_directories() across the
call to free().
Signed-off-by: Michael Haggerty
---
sha1_file.c | 4
Instead of writing the name of the reflog file into a strbuf that is
supplied by the caller but not needed there, write it into a local
temporary buffer and remove the strbuf parameter entirely.
And while we're adjusting the function signature, reorder the arguments
to move the input parameters
This function doesn't do anything beyond call files_log_ref_write(), so
replace it with the latter at its call sites.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24 ++--
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git
The behavior of refname_is_safe() was changed in
e40f355 "refname_is_safe(): insist that the refname already be normalized",
2016-04-27
without a corresponding update to its docstring. The function is in fact
stricter than documented, because it now insists that the result of
normalizing
The behavior of this function (especially how it handles errors) is
quite different depending on whether we are willing to create the reflog
vs. whether we are only trying to open an existing reflog. So separate
the code paths.
This also simplifies the next steps.
Signed-off-by: Michael Haggerty
This function will most often be called by log_ref_write_1(), which
wants to append to the reflog file. In that case, it is silly to close
the file only for the caller to reopen it immediately. So, in the case
that the file was opened, pass the open file descriptor back to the
caller.
Instead of coding the retry loop inline, use raceproof_create_file() to
make lock acquisition safe against directory creation/deletion races.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 35 +--
1 file changed, 9 insertions(+),
`lflags` is set a single time then never changed, so just inline it.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index be4ffdc..7d4658a 100644
---
Instead of looking on the filesystem inside ".git/refs/remotes/origin",
use "git for-each-ref" to check for leftover references under the
remote's old name.
Signed-off-by: Michael Haggerty
---
t/t5505-remote.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
Change log_ref_setup() to use raceproof_create_file() to create the new
logfile. This makes it more robust against a race against another
process that might be trying to clean up empty directories while we are
trying to create a new logfile.
This also means that it will only call
It is simpler to derive the path to the file that must be deleted from
"lock->ref_name" than from the lock_file object.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/refs/files-backend.c
* Don't capitalize error strings
* Report true paths of affected files
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 3f18a01..49a119c
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index f902393..be4ffdc 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2631,7 +2631,7 @@
It's bad manners and surprising and therefore error-prone.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 16 +---
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 92a9d99..88f8c7a
This is the standard nomenclature.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 9abd7c3..92a9d99 100644
--- a/refs/files-backend.c
+++
Besides shortening the code, this saves an unnecessary call to
safe_create_leading_directories_const() in almost all cases.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 73 +---
1 file changed, 30 insertions(+),
The exit path for SCLD_EXISTS wasn't setting errno, which some callers
use to generate error messages for the user. Fix the problem and
document that the function sets errno correctly to help avoid similar
regressions in the future.
Signed-off-by: Michael Haggerty
---
Add a new "flags" parameter that tells the function whether to remove
empty parent directories of the loose reference file, of the reflog
file, or both. The new functionality is not yet used.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 24
When deleting/pruning references, remove any directories that are made
empty by the deletion of loose references or of reflogs. Otherwise such
empty directories can survive forever and accumulate over time. (Even
'pack-refs', which is smart enough to remove the parent directories of
loose
It was hardly doing anything anymore, and had only one caller.
Signed-off-by: Michael Haggerty
---
refs/files-backend.c | 25 +++--
1 file changed, 7 insertions(+), 18 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index
This is v4 of this patch series. Thanks to Peff, Junio, Jake, and
Philip for their feedback about v3. I believe I have addressed all of
the comments about v1 [1], v2 [2], and v3 [3].
Changes since v3:
* Insert a new first patch correcting the docstring of
`refname_is_safe()`.
* In
I just released `git test`, a script for running automated
tests across a range of Git commits and keeping track of the results in
git notes:
https://github.com/mhagger/git-test
This is a script that I've been using in one form or another for years
and I find it really handy [1].
Am 06.01.2017 um 08:32 schrieb Jeff King:
On Fri, Jan 06, 2017 at 02:26:02AM -0500, Jeff King wrote:
You'll notice that it actually calls wait() on the pager. That's due to
a3da882120 (pager: do wait_for_pager on signal death, 2009-01-22), which
IIRC was addressing a very similar problem. We
Hi,
On Fri, 6 Jan 2017, Anton Tsyganenko wrote:
> When I run a tool from tools menu in the standard git gui, the output
> seems to have wrong encoding. For example, add a tool called "encoding
> test" that runs command "echo Проверка", then run it. In the output
> window "Ð?Ñ?овеÑ?ка" in
Hi,
On Fri, 6 Jan 2017, Brandon Tolsch wrote:
> git --version: 2.11.0
>
> When using git rebase -i to squash a series of commits that includes
> more than 10 commits, the generated commit message you are given to
> edit counts the old messages incorrectly. It will say the total
> number of
Hi Kyle,
On Thu, 5 Jan 2017, Kyle Meyer wrote:
> Move the detached HEAD check from branch_get_push_1() to
> branch_get_push() to avoid setting branch->push_tracking_ref when
> branch is NULL.
>
> Signed-off-by: Kyle Meyer
Good point.
> diff --git a/remote.c b/remote.c
>
On Fri, Jan 06, 2017 at 02:32:25 -0500, Jeff King wrote:
> And here's a patch to do that. It seems to work.
Nice, thanks! This works very well for me too.
--
Trygve Aaberge
On Thu, Jan 5, 2017 at 9:02 PM, Stefan Beller wrote:
> On Thu, Jan 5, 2017 at 2:06 AM, Roland Illig wrote:
>> Git 2.11.0 gives a wrong error message after the following commands:
>>
>> $ git init
>> $ echo hello >file
>> $ git add file
>> $ git commit -m
Am 06.01.2017 um 02:09 schrieb Richard Hansen:
If rerere is enabled and no pathnames are given, run cd_to_toplevel
before running 'git diff --name-only' so that 'git diff --name-only'
sees the pathnames emitted by 'git rerere remaining'.
Also run cd_to_toplevel before running 'git rerere
When I run a tool from tools menu in the standard git gui, the output
seems to have wrong encoding. For example, add a tool called "encoding
test" that runs command "echo Проверка", then run it. In the output
window "ÐÑовеÑка" in printed instead of "Проверка".
signature.asc
Description:
git --version: 2.11.0
When using git rebase -i to squash a series of commits that includes
more than 10 commits, the generated commit message you are given to
edit counts the old messages incorrectly. It will say the total
number of commits is (actual % 10) (if they were 0-based) and it will
73 matches
Mail list logo