Hi,
"Boettger, Heiko" writes:
> Hi,
>
> I discovered an interesting problem when using `git checkout` to which
> I couldn't find a good solution. We have an automatic system trying to
> checkout a branch only when it exists. To do so we check whether `git
> rev-parse` finds a commit for given br
It seems to me that push's manpage contains a couple of inaccurate (or
at least confusingly incomplete) statements about omitting the
destination part of the refspec.
First, the refspec section of the manpage has this to say:
If `git push []` without any `` argument is set to
update some
Remove the mention of symlinks from the test description because
several tests that are not related to symlinks have been added since
this file was introduced long ago.
Signed-off-by: Kyle Meyer
---
t/t3000-ls-files-others.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t
ing add_to_index() to error when given a
git directory where HEAD can't be resolved. To avoid the embedded
repository warning and hint, call check_embedded_repo() only after
add_file_to_index() succeeds because, in general, its output doesn't
make sense if adding to the index fails.
commit will
make 'git add' fail when given a repository that doesn't have a commit
checked out.
Signed-off-by: Kyle Meyer
---
git-submodule.sh | 7 +++
t/t7400-submodule-basic.sh | 11 ++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/git-submodu
use,
technically, this series also concerns repositories that have
commit objects but are on an unborn branch.
* Change the "git submodule add" error message to match the wording
of the new error message added in add_to_index().
* Consistently use "expect" rat
d shows, calling 'git add' on a
repository with no commit checked out will now raise an error. While
this is the desired behavior, note that the output isn't yet
appropriate. The next commit will improve this output.
Signed-off-by: Kyle Meyer
---
dir.c
Junio C Hamano writes:
> Kyle Meyer writes:
>> As the required update to t3700-add shows, being looser with the check
>> means that we're stricter when adding empty repositories to the index:
>>
>> % git add repo
>> warning: adding embedded git re
Junio C Hamano writes:
> Kyle Meyer writes:
>
>> a2d5156c2b (resolve_gitlink_ref: ignore non-repository paths,
>> 2016-01-22) added a test to t3000-ls-files-others.sh to check that
>> 'ls-files -o' does not die() when given a subdirectory that looks like
_ happen in the non-bogus scenarios that
will be added next. Rename the original subdirectory to highlight the
difference with the new one.
Signed-off-by: Kyle Meyer
---
t/t3009-ls-files-others-nonsubmodule.sh | 21 ++---
1 file changed, 18 insertions(+), 3 deletions(
test to a separate file in preparation for testing scenarios
with non-submodule repositories that are not bogus.
Signed-off-by: Kyle Meyer
---
t/t3000-ls-files-others.sh | 7 ---
t/t3009-ls-files-others-nonsubmodule.sh | 21 +
2 files changed, 21 insert
s. And if the caller really wants the previous
behavior, they can get it by adding a trailing slash.
Signed-off-by: Kyle Meyer
---
dir.c | 6 --
t/t3009-ls-files-others-nonsubmodule.sh | 22 +-
t/t3700-add.sh |
iles
in the sub-repository are added to the current repository.
Detect if the path is a repository with no commits and abort to avoid
getting into this state. Note that this check must come before the
'git add --dry-run' check because an upcoming commit will make 'git
add'
> Kyle Meyer writes:
>
> [...]
>
>> diff --git a/git-submodule.sh b/git-submodule.sh
>> index 514ede2596..6c74656027 100755
>> --- a/git-submodule.sh
>> +++ b/git-submodule.sh
>> @@ -234,10 +234,18 @@ cmd_add()
>> if test -z "$force&quo
Kyle Meyer writes:
[...]
> diff --git a/git-submodule.sh b/git-submodule.sh
> index 514ede2596..6c74656027 100755
> --- a/git-submodule.sh
> +++ b/git-submodule.sh
> @@ -234,10 +234,18 @@ cmd_add()
> if test -z "$force" &&
> ! git a
_ happen in the non-bogus scenarios that
will be added next. Rename the original subdirectory to highlight the
difference with the new one.
Signed-off-by: Kyle Meyer
---
t/t3009-ls-files-others-nonsubmodule.sh | 21 ++---
1 file changed, 18 insertions(+), 3 deletions(
n this situation, but it allows us to use the same
'git add --dry-run' condition as the ignored path case.
Signed-off-by: Kyle Meyer
---
git-submodule.sh | 12 ++--
t/t7400-submodule-basic.sh | 11 ++-
2 files changed, 20 insertions(+), 3 deletions(-)
ntracked
files of the no-commit/ repository to the index of the current
repository.
[*]: https://github.com/datalad/datalad/issues/3139#issuecomment-460542647
Kyle Meyer (4):
submodule: refuse to add repository with no commits
t3000: move non-submodule repo test to separate file
t
test to a separate file in preparation for testing scenarios
with non-submodule repositories that are not bogus.
Signed-off-by: Kyle Meyer
---
t/t3000-ls-files-others.sh | 7 ---
t/t3009-ls-files-others-nonsubmodule.sh | 21 +
2 files changed, 21 insert
s. And if the caller really wants the previous
behavior, they can get it by adding a trailing slash.
Signed-off-by: Kyle Meyer
---
dir.c | 6 --
t/t3009-ls-files-others-nonsubmodule.sh | 22 +-
t/t3700-add.sh |
Change it to "linkgit" so that the reference is properly rendered.
Signed-off-by: Kyle Meyer
---
Documentation/git-rebase.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 5629ba4c5d..6363d674b7 10
Signed-off-by: Kyle Meyer
---
Documentation/git-init.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-init.txt b/Documentation/git-init.txt
index 057076ca38..32880aafb0 100644
--- a/Documentation/git-init.txt
+++ b/Documentation/git-init.txt
@@ -128,7
Delete a misplaced word introduced by caafecfcf1 (rebase
--rebase-merges: adjust man page for octopus support, 2018-03-09).
Signed-off-by: Kyle Meyer
---
Documentation/git-rebase.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/git-rebase.txt b/Documentation
Ævar Arnfjörð Bjarmason writes:
> On Tue, Oct 02 2018, Taylor Blau wrote:
[...]
>> Specifically, I've wanted the 'hg absorb' command. My understanding of
>> the commands functionality is that it builds a sort of flamegraph-esque
>> view of the blame, and then cascades downwards parts of a chang
d-off-by: Kyle Meyer
---
builtin/range-diff.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index f52d45d9d6..0aa9bed41f 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -25,7 +25,7 @@ int cmd_range_diff(int argc,
Junio C Hamano writes:
> Johannes Schindelin writes:
[...]
>>> - N_("color both diff and diff-between-diffs")),
>>> + N_("restrict coloring to outer diff markers")),
>>
>> How about "use simple diff colors" instead?
That's certainly better than the
275267937b (range-diff: make dual-color the default mode, 2018-08-13)
replaced --dual-color with --no-dual-color but left the option's
summary untouched. Rewrite the summary to describe --no-dual-color
rather than dual-color.
Helped-by: Jonathan Nieder
Signed-off-by: Kyle Meyer
---
bu
Jonathan Nieder writes:
- N_("color both diff and diff-between-diffs")),
+ N_("restrict coloring to outer diff markers")),
[...]
> Aha: I think you're missing a few words (e.g. "color only according to
> outer diff markers"). Though based on
Jonathan Nieder writes:
[...]
> What is an outer diff marker?
The diff markers from the diff of patches as opposed to the ones from
the original patches. I took the term from git-range-diff.txt:
--no-dual-color::
When the commit diffs differ, `git range-diff` recreates the
275267937b (range-diff: make dual-color the default mode, 2018-08-13)
replaced --dual-color with --no-dual-color but left the option's
summary untouched. Rewrite the summary to describe --no-dual-color
rather than dual-color.
Signed-off-by: Kyle Meyer
---
builtin/range-diff.c | 2 +-
1
[+cc Stefan Monnier]
Jonathan Nieder writes:
> (cc-ing Scott)
[...]
> I believe you're thinking of TicGit[1].
>
> Some other related work is listed at [2]. Most of these projects have
> gone quiet:
>
> - ditz[3]
> - git-issues[4]
> - cil[5]
> - Bugs Everywhere[6]
> - milli by Steve Kemp, whic
Signed-off-by: Kyle Meyer
---
Documentation/gitworkflows.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/gitworkflows.txt b/Documentation/gitworkflows.txt
index 926e044d0..ca11c7bda 100644
--- a/Documentation/gitworkflows.txt
+++ b/Documentation
Ævar Arnfjörð Bjarmason writes:
[...]
> These days these modes have very few if users, and users of git aren't
s/if// or s/if/if any/ ?
--
Kyle
Jeff King writes:
> Prior to this commit, we show both entries with
> identical reflog messages. After this commit, we show
> only the "comes back" entry. See the update in t3200
> which demonstrates this.
>
> Arguably either is fine, as the whole double-entry
> thin
Jeff King writes:
> +test_expect_failure 'walking multiple reflogs shows all' '
> + # We expect to see all entries for all reflogs, but interleaved by
> + # date, with order no the command line breaking ties. We
s/order no/order on/
--
Kyle
Bryan Turner writes:
[...]
> If you don't need the ancestor traversals "git name-rev" provides,
> "git for-each-ref --count 1 --format "%(refname:short)" --points-at
> refs/heads/" might work. That only goes back to Git 2.7.0,
> though; still quite a ways off your 1.9 target. ("git branch
> --p
Junio C Hamano writes:
> Kyle Meyer writes:
>
>> [*] A bit more information on why I'm trying to do this: In Magit, we
>> have a work-in-progress feature that takes "snapshots" of changes
>> before they are committed. These snapshots are
Hello,
I'm trying to restrict name-rev's output to a ref whose name begins with
the supplied pattern [*]. Looking at "man git-name-rev",
builtin/name-rev.c, and wildmatch.c, I don't see a way to accomplish
this with "--refs=".
Say, for example, that I want to limit name-rev's output to a ref in
Kyle Meyer writes:
> Eh, sorry about that. I haven't dug very deeply, but it seems like the
> entry is still in .git/logs/HEAD, while "git reflog" is only showing
> they latest entry.
s/entry is still/missing entries are still/
Junio C Hamano writes:
> "brian m. carlson" writes:
>
>> I get the following on 2.11.0:
>>
>> 2cbfbd5 HEAD@{0}:
>> 2cbfbd5 HEAD@{1}: checkout: moving from cPanel to master
>> eaf8db2 HEAD@{2}: checkout: moving from master to cPanel
>> 2cbfbd5 HEAD@{3}: clone: from
>> https://b...@git.crustytoot
The configuration variable log.showSignature is mentioned in git-log's
manpage. Document it in git-config's manpage as well.
Signed-off-by: Kyle Meyer
---
Documentation/config.txt | 4
1 file changed, 4 insertions(+)
diff --git a/Documentation/config.txt b/Documentation/config
Given that other instances of "{...}" in the revision documentation
represent literal characters of revision specifications, describing
the rev^-n shorthand as "^-{}" incorrectly suggests that
something like "master^-{1}" is an acceptable form.
Signed-off-by:
Structure calls as
test_expect_success 'description' '
body
'
Use double quotes for the description if it requires parameter
expansion or contains a single quote.
Signed-off-by: Kyle Meyer
---
This patch follows up on a recent t1400 series:
https://
Signed-off-by: Kyle Meyer
---
Documentation/config.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 0d8df5a9f..1df196545 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -737,13 +737,13
Junio C Hamano writes:
> Jeff King writes:
>
>> On Mon, Mar 20, 2017 at 08:56:11PM -0400, Kyle Meyer wrote:
[...]
>>> I also considered
>>>
>>> * making the quoting/spacing/breaks around the test descriptions and
>>> bodies more con
Jeff King writes:
> On Mon, Mar 20, 2017 at 08:56:13PM -0400, Kyle Meyer wrote:
[...]
>> I'm confused about the setup for the "logged by touch" tests.
>> d0ab05849 (tests: remove some direct access to .git/logs, 2015-07-27)
>> changed the setup to delete
Jeff King writes:
> On Mon, Mar 20, 2017 at 08:56:11PM -0400, Kyle Meyer wrote:
[...]
>> * moving the here-documents for log creation into the following
>> tests, but I don't think it's worth it because it makes already
>> long lines even longe
Signed-off-by: Kyle Meyer
---
t/t1400-update-ref.sh | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index be8b113b1..c5c8e95fc 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update
This test case redirects stdout and stderr to output files, but,
unlike the other cases of redirection in the t1400 tests, these files
are not examined downstream. Remove the redirection so that the
output is visible when running the tests verbosely.
Signed-off-by: Kyle Meyer
---
t/t1400
tests to disable core.logAllRefUpdates
explicitly so that the behavior does not depend on the default value.
While we're here, update the "logged by config" tests to use
test_config() rather than setting core.logAllRefUpdates to "true"
outside of the tests.
Signed-off
These patches follow up on Peff's suggestion to modernize the style in
t1400-update-ref.sh.
20170217082253.kxjezkxfqkfxj...@sigill.intra.peff.net
The first two commits aren't concerned with "modernizing" the tests,
but instead address issues that I noticed while looking more closely
at t1400.
Move cleanup lines that occur after test blocks into
test_when_finished calls within the test bodies. Don't move cleanup
lines that seem to be related to mutiple tests rather than a single
test.
Signed-off-by: Kyle Meyer
---
t/t1400-update-ref.sh
A few tests share their description with another test. Extend the
descriptions to indicate how the tests differ.
Signed-off-by: Kyle Meyer
---
t/t1400-update-ref.sh | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index
Duy Nguyen writes:
> You'll probably want to update the comment block above if msg can be
> NULL. We have _very_ good documentation in this file, let's keep it
> uptodate.
Looking at how other functions in refs.h document their "msg" or
"logmsg" parameter, none seem to mention it explicitly. up
Junio C Hamano writes:
> These looked reasonable. I had to resolve conflicts with another
> topic in flight that removed set_worktree_head_symref() function
> while queuing, and I think I resolved it correctly, but please
> double check what is pushed out on 'pu'.
The merge looks right to me, t
e "delete_refs"
was written instead of "delete_ref".
Kyle Meyer (4):
delete_ref: accept a reflog message argument
update-ref: pass reflog message to delete_ref()
rename_ref: replace empty message in HEAD's log
branch: record creation of renamed branch in H
xtend HEAD's log to also include the second
part of the rename, the creation of the new branch.
Helped-by: Jeff King
Signed-off-by: Kyle Meyer
---
refs/files-backend.c | 2 +-
t/t3200-branch.sh| 5 +
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/
set. In contrast, the update for HEAD has REF_LOG_ONLY set by
split_head_update(), resulting in the deletion being logged.
Signed-off-by: Kyle Meyer
---
builtin/am.c | 4 ++--
builtin/branch.c | 2 +-
builtin/notes.c| 4 ++--
builtin/remote.c | 4 ++--
builtin/replac
d for
deletions, so it may not be worth the effort.
Based-on-patch-by: Jeff King
Signed-off-by: Kyle Meyer
---
branch.c | 5 +++--
branch.h | 3 ++-
builtin/branch.c | 5 +++--
refs.h | 3 ++-
refs/files-backend.c | 4 ++--
t/t3200-branch.sh| 5 +++-
Now that delete_ref() accepts a reflog message, pass the user-provided
message to delete_ref() rather than silently dropping it.
Signed-off-by: Kyle Meyer
---
builtin/update-ref.c | 2 +-
t/t1400-update-ref.sh | 18 ++
2 files changed, 19 insertions(+), 1 deletion(-)
diff
Jeff King writes:
> On Fri, Feb 17, 2017 at 02:43:50PM -0500, Jeff King wrote:
>
>> Yes. I think the options are basically (in order of decreasing
>> preference in my opinion):
>>
>> 1. Log a rename entry (same sha1, but note the rename in the free-form
>> text).
>>
>> 2. Log a delete
Junio C Hamano writes:
[...]
> Do we even want these "internal" delete_ref() invocations to be
> logged in HEAD's reflog? I understand that this is inside the
> implementation of renaming an old ref to a new ref, and reflog
> message given to delete_ref() would matter only if the HEAD happens
>
Jeff King writes:
[...]
>> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
>> index b0ffc0b57..65918d984 100755
>> --- a/t/t1400-update-ref.sh
>> +++ b/t/t1400-update-ref.sh
>> @@ -85,6 +85,15 @@ test_expect_success "delete $m (by HEAD)" '
>> '
>> rm -f .git/$m
>>
>> +test_expect_
Junio C Hamano writes:
> Jeff King writes:
>
>>> diff --git a/refs.h b/refs.h
>>> index 9fbff90e7..81627a63d 100644
>>> --- a/refs.h
>>> +++ b/refs.h
>>> @@ -277,7 +277,7 @@ int reflog_exists(const char *refname);
>>> * be NULL_SHA1. flags is passed through to ref_transaction_delete().
>>> *
ke a message argument and pass
it along to ref_transaction_delete(). Modify all callers to pass NULL
for the new message argument; no change in behavior is intended.
Signed-off-by: Kyle Meyer
---
builtin/am.c | 4 ++--
builtin/branch.c | 2 +-
builtin/notes.c| 4 ++
g a checked out branch.
Signed-off-by: Kyle Meyer
---
I'm not sure if the test here (or in the next patch) is worth including.
builtin/update-ref.c | 2 +-
t/t1400-update-ref.sh | 9 +
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/builtin/update-ref.c b/builti
overs the renaming event with a message of "Branch:
renamed ...".
Signed-off-by: Kyle Meyer
---
refs/files-backend.c | 8 +++-
t/t3200-branch.sh| 4
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index ffa75d816..b
[Sorry for the slow response.]
Jeff King writes:
> On Mon, Jan 16, 2017 at 06:17:29PM -0500, Kyle Meyer wrote:
[...]
>>$ cat .git/logs/refs/heads/new-master
>>00000... 68730... Kyle Meyer 1484607020 -0500 commit
>> (initial): Add file.txt
>>6
Duy Nguyen writes:
> On Thu, Feb 2, 2017 at 7:37 PM, Kyle Meyer wrote:
[...]
>> * COMMIT_EDITMSG in .git/modules//: set working tree to the
>>output of "git rev-parse --show-toplevel"
>>
>> * COMMIT_EDITMSG in .git/worktrees//: set working tre
Duy Nguyen writes:
> On Thu, Feb 2, 2017 at 10:55 AM, Kyle Meyer wrote:
>>
>> As of 6311cfaf9 (init: do not set unnecessary core.worktree,
>> 2016-09-25), "git init --separate-git-dir" no longer sets core.worktree
>> (test below). Based on the commit messa
Hello,
As of 6311cfaf9 (init: do not set unnecessary core.worktree,
2016-09-25), "git init --separate-git-dir" no longer sets core.worktree
(test below). Based on the commit message and the corresponding thread
[1], I don't think this change in behavior was intentional, but I wasn't
able to under
git branch -m master new-master
resulted in the following reflogs:
$ cat .git/logs/refs/heads/new-master
0... 68730... Kyle Meyer 1484607020 -0500 commit
(initial): Add file.txt
68730... 68730... Kyle Meyer 1484607020 -0500 Branch:
renamed refs/heads/master to refs/hea
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 pointin
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(+), 3 deleti
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 HEAD^0 junio/pu -- t/
> junio/pu:
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(+), 3 deleti
Hello,
When a ".git" file points to another repo, a ".git/gitdir" file is
created in that repo.
For example, running
$ mkdir repo-a repo-b
$ cd repo-a
$ git init
$ cd ../repo-b
$ echo "gitdir: ../repo-a/.git" > .git
$ git status
results in a file "repo-a/.git/gitdir" tha
77 matches
Mail list logo