[RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-28 Thread Karthik Nayak
This is part of my GSoC project to unify git tag -l, git branch -l, git for-each-ref. This patch series is continued from: Gmane (v6) http://article.gmane.org/gmane.comp.version-control.git/274726 This is a RFC version and I'm sending to ensure that I'm on the right path. This version also

default configuration files on cygwin

2015-07-28 Thread Filippo Gatti
Hi, I'm currently running git on a cygwin platform. I would like to know how i can set up a sort of configuration file to launch automatically the ssh-agent and get connected to github (for istance) directly. Thanks Filippo -- To unsubscribe from this list: send the line unsubscribe git in

Re: git branch command is incompatible with bash

2015-07-28 Thread Jakub Narębski
W dniu 2015-07-28 o 09:28, Johannes Sixt pisze: Am 27.07.2015 um 23:49 schrieb Junio C Hamano: Johannes Sixt j...@kdbg.org writes: Try branchName=$(git rev-parse --abbrev-ref HEAD) Hmm, interesting. $ git checkout --orphan notyet $ git rev-parse --abbrev-ref HEAD $ git

Re: [PATCH v6 01/10] ref-filter: introduce 'ref_formatting_state'

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: -static void print_value(struct atom_value *v, int quote_style) +static void apply_formatting_state(struct ref_formatting_state *state, +struct atom_value *v, struct strbuf *value) { - struct strbuf sb =

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Christian Couder
On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak karthik@gmail.com wrote: diff --git a/ref-filter.h b/ref-filter.h index 7d1871d..3458595 100644 --- a/ref-filter.h +++ b/ref-filter.h @@ -5,6 +5,7 @@ #include refs.h #include commit.h #include parse-options.h +#include revision.h /*

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak karthik@gmail.com wrote: Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()'

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Christian Couder
On Tue, Jul 28, 2015 at 9:11 AM, Karthik Nayak karthik@gmail.com wrote: diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index a67138a..897cd81 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -11,7 +11,7 @@ SYNOPSIS 'git branch'

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -133,4 +133,20 @@ test_expect_success 'reverse version sort' ' test_cmp expect actual ' +get_color () +{ + git config --get-color no.such.slot $1 +} +

[RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' data structures and make changes to support the new data structures. This is a part of the process of porting 'branch.c' to use 'ref-filter' APIs. This is a temporary step before porting 'branch.c' to use 'ref-filter' completely. As this is a temporary step, most

[RFC/PATCH 05/11] branch: fix width computation

2015-07-28 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Remove unnecessary variables from ref_list and ref_item which were used for width computation. Make other changes accordingly. This patch is a precursor for porting branch.c to use ref-filter APIs. Based-on-patch-by: Jeff King p...@peff.net Mentored-by:

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Jacob Keller
On Mon, Jul 27, 2015 at 11:56 PM, Karthik Nayak karthik@gmail.com wrote: The 'ifexists' atom allows us to print a required format if the preceeding atom has a value. If the preceeding atom has no value then Don't you mean following atom here? since you do document it as the next atom below

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Christian Couder
On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak karthik@gmail.com wrote: +static void ref_array_append(struct ref_array *array, const char *refname) +{ + size_t len = strlen(refname); + struct ref_array_item *ref = xcalloc(1, sizeof(struct ref_array_item) + len + 1); +

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -149,4 +149,25 @@ test_expect_success 'check `colornext` format option' ' test_cmp expect actual ' +test_expect_success 'check `ifexists` format option' ' +

Re: [RFC/PATCH 05/11] branch: fix width computation

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Why did send-email add this From: header? Strange, it has the same content as your actual From: field. Remove unnecessary variables from ref_list and ref_item which were used for width computation. Make

Re: Log messages beginning # and git rebase -i

2015-07-28 Thread Ed Avis
Eric Sunshine sunshine at sunshineco.com writes: the editing for the combined log message treats lines beginning with # as comments. This means that if you are not careful the commit message can get lost on rebasing. I suggest that git rebase should add an extra space at the start 'git rebase

Re: git branch command is incompatible with bash

2015-07-28 Thread Johannes Sixt
Am 27.07.2015 um 23:49 schrieb Junio C Hamano: Johannes Sixt j...@kdbg.org writes: Try branchName=$(git rev-parse --abbrev-ref HEAD) Hmm, interesting. $ git checkout --orphan notyet $ git rev-parse --abbrev-ref HEAD $ git symbolic-ref --short HEAD Please don't scare

Re: [RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: + if (skip_prefix(name, objectname:size=, p)) { + unsigned int size = atoi(p); You have the same problem as for tag.c: don't use atoi, and make accurate error checking (absence of value, negative value, non-integer value). If you

[RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Karthik Nayak
The 'colornext' atom allows us to color only the succeeding atom with a particular color. This resets any previous color preferences set. It is not compatible with `padright`. This is required for printing formats like `git branch -vv` where the upstream is colored in blue. Mentored-by: Christian

[RFC/PATCH 06/11] branch: roll show_detached HEAD into regular ref_list

2015-07-28 Thread Karthik Nayak
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(). Bump get_head_description() to the top. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder

[RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Karthik Nayak
The 'ifexists' atom allows us to print a required format if the preceeding atom has a value. If the preceeding atom has no value then the format given is not printed. e.g. to print [refname] we can now use the format %(ifexists:[%s])%(refname). Add documentation and test for the same.

[RFC/PATCH 03/11] ref-filter: add option to filter only branches

2015-07-28 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Add an option in 'filter_refs()' to use 'for_each_branch_ref()' and filter refs. This type checking is done by adding a 'FILTER_REFS_BRANCHES' in 'ref-filter.h'. Add an option in 'ref_filter_handler()' to filter different types of branches by calling

[RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-28 Thread Karthik Nayak
We check if given ref is the current branch in print_ref_list(). Move this check to print_ref_item() where it is checked right before printing. Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy

[RFC/PATCH 08/11] branch: drop non-commit error reporting

2015-07-28 Thread Karthik Nayak
Based-on-patch-by: Jeff King p...@peff.net Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr Signed-off-by: Karthik Nayak karthik@gmail.com --- builtin/branch.c | 18 -- 1 file changed, 4 insertions(+), 14

[RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Karthik Nayak
From: Karthik Nayak karthik@gmail.com Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value for X is 5. Hence any value lesser than 5 will default to 5 characters. Mentored-by: Christian Couder

Re: [RFC/PATCH 11/11] branch: add '--points-at' option

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak karthik@gmail.com wrote: Add the '--points-at' option provided by 'ref-filter'. The option lets the user to list only branches which points at the given object. Add documentation and tests for the same. Mentored-by: Christian Couder

Re: builtin/tag.c issue with sort option

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 3:27 PM, Jacob Keller jacob.kel...@gmail.com wrote: When passing -n on the command line, if you have configured sort manually, you get an error as it thinks you passed --sort and -n. It should automatically disable tag_sort if it wasn't passed from the command line, as

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: In fact, you can easily do a notes merge in a _bare_ repo... You keep repeating that but I do not think it is relevant at all. If you have a bare repository, you either (1) do not have any worktree associated with it; or (2) have worktrees associated

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Michael Haggerty mhag...@alum.mit.edu writes: It sounds like what a notes merge really wants is a new linked worktree that has branch refs/notes/foo checked out: * This would allow multiple notes merges to take place at the same time provided they target different merge references. * This

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 4:17 AM, Junio C Hamano gits...@pobox.com wrote: Perhaps you meant by per repo to mean per $GIT_DIR in this message, and if that is the case, then I think we are in agreement. No, by per repo I mean per $GIT_COMMON_DIR (I haven't followed the linked worktree effort, so

Re: [PATCH] notes: handle multiple worktrees

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 12:12 AM, Junio C Hamano gits...@pobox.com wrote: David Turner dtur...@twopensource.com writes: Prevent merges to the same notes branch from different worktrees. Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using the same code we use to check that two HEADs in

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: Johan Herland jo...@herland.net writes: However, in any case, notes merges are always per _repo_ and never per _worktree_, so this is all unrelated to the current patch/discussion AFAICS. Thanks for chiming in, but I actually think you are confused.

Re: git branch command is incompatible with bash

2015-07-28 Thread Scott Schmit
On Tue, Jul 28, 2015 at 08:23:40AM -0700, Junio C Hamano wrote: Johannes Sixt j...@kdbg.org writes: Are you trying to say that the result of 'rev-parse --abbrev-ref HEAD' is suboptimal and that of 'symbolic-ref --short HEAD' is OK? My Interesting was primarily about that I wasn't aware of

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 2:56 AM, Michael Haggerty mhag...@alum.mit.edu wrote: Johan Herland jo...@herland.net writes: Here is where we start to differ. I would say that starting a notes merge is completely unrelated to your worktree. Consider this: It sounds like what a notes merge really

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Tue, Jul 28, 2015 at 9:44 PM, Junio C Hamano gits...@pobox.com wrote: Junio C Hamano gits...@pobox.com writes: David Turner dtur...@twopensource.com writes: All-caps files like NOTES_MERGE_REF are pseudorefs, and thus are per-worktree. We don't want multiple notes merges happening at once

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: Yes, almost. There are some complications with the concept of checking out a notes tree: - The notes tree fanout must be flattened (so that when merging two note trees with different fanout, conflicting notes (e.g. deadbeef... and de/adbeef) are

builtin/tag.c issue with sort option

2015-07-28 Thread Jacob Keller
When passing -n on the command line, if you have configured sort manually, you get an error as it thinks you passed --sort and -n. It should automatically disable tag_sort if it wasn't passed from the command line, as you probably know what you are doing when passing -n I'm attempting to work up

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 12:52 AM, Junio C Hamano gits...@pobox.com wrote: Johan Herland jo...@herland.net writes: However, in any case, notes merges are always per _repo_ and never per _worktree_, so this is all unrelated to the current patch/discussion AFAICS. Thanks for chiming in, but I

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: Here is where we start to differ. I would say that starting a notes merge is completely unrelated to your worktree. Consider this: ... This is not the case for notes merges. If I start a notes merge from worktree A, there is no occupation of that

Re: [RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 1:12 PM, Karthik Nayak karthik@gmail.com wrote: On Tue, Jul 28, 2015 at 6:39 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: We check if given ref is the current branch in print_ref_list(). Move this check to

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Jacob Keller
On Tue, Jul 28, 2015 at 5:56 PM, Michael Haggerty mhag...@alum.mit.edu wrote: Johan Herland jo...@herland.net writes: Here is where we start to differ. I would say that starting a notes merge is completely unrelated to your worktree. Consider this: It sounds like what a notes merge really

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 2:33 AM, Junio C Hamano gits...@pobox.com wrote: Johan Herland jo...@herland.net writes: Here is where we start to differ. I would say that starting a notes merge is completely unrelated to your worktree. Consider this: ... This is not the case for notes merges. If I

Re: default configuration files on cygwin

2015-07-28 Thread Chris Packham
On Tue, Jul 28, 2015 at 7:10 PM, Filippo Gatti filippo.ga...@centralesupelec.fr wrote: Hi, I'm currently running git on a cygwin platform. I would like to know how i can set up a sort of configuration file to launch automatically the ssh-agent and get connected to github (for istance)

Re: [RFC/PATCH 03/11] ref-filter: add option to filter only branches

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: +static int filter_branch_kind(struct ref_filter *filter, const char *refname) +{ + int kind, i; + + static struct { + int kind; + const char *prefix; + } ref_kind[] = { + { REF_LOCAL_BRANCH,

Re: [RFC/PATCH 09/11] branch.c: use 'ref-filter' data structures

2015-07-28 Thread Matthieu Moy
Christian Couder christian.cou...@gmail.com writes: On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak karthik@gmail.com wrote: +static void ref_array_append(struct ref_array *array, const char *refname) +{ + size_t len = strlen(refname); + struct ref_array_item *ref =

Re: [RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: This version also doesn't use the printing options provided by branch.c. Do you mean provided by ref-filter.{c,h}? I wanted to discuss how exactly to go about that, because in branch.c, we might need to change the --format based on attributes such

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: @@ -458,7 +345,7 @@ static void add_verbose_info(struct strbuf *out, struct ref_array_item *item, } if (item-kind == REF_LOCAL_BRANCH) - fill_tracking_info(stat, item-refname, filter-verbose 1); +

Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'

2015-07-28 Thread Duy Nguyen
This seems like a good thing to fix (i.e. make sure XX is not ambiguous before creating it with git checkout -b XX) -- Forwarded message -- From: Andreas Beckmann a...@debian.org Date: Tue, Jul 28, 2015 at 9:18 PM Subject: Bug#793884: git: allows nonsensical command 'git checkout

[RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with calls to the 'ref-filter' library. Make 'tag.c' use the 'filter_refs()' function provided by 'ref-filter' to filter out tags based on the options set. We

[RFC/PATCH 11/11] branch: add '--points-at' option

2015-07-28 Thread Karthik Nayak
Add the '--points-at' option provided by 'ref-filter'. The option lets the user to list only branches which points at the given object. Add documentation and tests for the same. Mentored-by: Christian Couder christian.cou...@gmail.com Mentored-by: Matthieu Moy matthieu@grenoble-inp.fr

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Christian Couder
On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak karthik@gmail.com wrote: @@ -712,6 +713,15 @@ static void populate_value(struct ref_array_item *ref) v-modifier_atom = 1; v-pad_to_right = 1; continue; + }

Re: [RFC/PATCH 07/11] branch: move 'current' check down to the presentation layer

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: We check if given ref is the current branch in print_ref_list(). Move this check to print_ref_item() where it is checked right before printing. This means that the '*' and the different color are coded in C, hence it's not possible to mimick this

Re: [RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:05 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: This version also doesn't use the printing options provided by branch.c. Do you mean provided by ref-filter.{c,h}? Yes! my bad. I wanted to discuss how exactly to

Re: git branch command is incompatible with bash

2015-07-28 Thread Junio C Hamano
Johannes Sixt j...@kdbg.org writes: Are you trying to say that the result of 'rev-parse --abbrev-ref HEAD' is suboptimal and that of 'symbolic-ref --short HEAD' is OK? My Interesting was primarily about that I wasn't aware of the --abbrev-ref option. Yes, I am sure some time ago I accepted a

Re: [RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Junio C Hamano
Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value for X is 5. Hence any value lesser than 5 will default to 5 characters.

Re: [RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 9:13 PM, Junio C Hamano gits...@pobox.com wrote: Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value

Re: Log messages beginning # and git rebase -i

2015-07-28 Thread Matthieu Moy
Ed Avis e...@waniasset.com writes: Eric Sunshine sunshine at sunshineco.com writes: the editing for the combined log message treats lines beginning with # as comments. This means that if you are not careful the commit message can get lost on rebasing. I suggest that git rebase should add an

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:43 PM, Christian Couder christian.cou...@gmail.com wrote: On Tue, Jul 28, 2015 at 8:56 AM, Karthik Nayak karthik@gmail.com wrote: @@ -712,6 +713,15 @@ static void populate_value(struct ref_array_item *ref) v-modifier_atom = 1;

Re: [RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:12 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: + if (skip_prefix(name, objectname:size=, p)) { + unsigned int size = atoi(p); You have the same problem as for tag.c: don't use atoi, and make

Re: [RFC/PATCH 02/11] ref-filter: add 'colornext' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:15 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -133,4 +133,20 @@ test_expect_success 'reverse version sort' ' test_cmp expect

Re: [RFC/PATCH 01/11] ref-filter: add %(objectname:size=X) option

2015-07-28 Thread Junio C Hamano
Karthik Nayak karthik@gmail.com writes: From: Karthik Nayak karthik@gmail.com Add support for %(objectname:size=X) where X is a number. This will print the first X characters of an objectname. The minimum value for X is 5. Hence any value lesser than 5 will default to 5 characters.

Re: [PATCH v4 01/10] ref-filter: add option to align atoms to the left

2015-07-28 Thread Duy Nguyen
On Mon, Jul 27, 2015 at 5:18 PM, Duy Nguyen pclo...@gmail.com wrote: On Mon, Jul 27, 2015 at 2:39 PM, Jacob Keller jacob.kel...@gmail.com wrote: On Sun, Jul 26, 2015 at 5:39 PM, Duy Nguyen pclo...@gmail.com wrote: On Sun, Jul 26, 2015 at 11:08 AM, Eric Sunshine sunsh...@sunshineco.com wrote:

Re: [RFC/PATCH 06/11] branch: roll show_detached HEAD into regular ref_list

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: 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(). Again, this lacks the why? explanation. Bump get_head_description() to the

Re: Do you need a loan?

2015-07-28 Thread JASMIE LOAN COMPANY
Welcome to JASMIE LOAN COMPANY. We give out loans of all kinds. If you are in need of urgent loan kindly contact us instant approval for just 0.5% interest rate. APPLICATION FORM NAME... COUNTRY AMOUNT NUMBER. ADDRESS DURATION... PURPOSE

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:39 PM, Christian Couder christian.cou...@gmail.com wrote: On Tue, Jul 28, 2015 at 9:11 AM, Karthik Nayak karthik@gmail.com wrote: diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index a67138a..897cd81 100644 ---

Re: [RFC/PATCH 10/11] branch.c: use 'ref-filter' APIs

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:27 PM, Jacob Keller jacob.kel...@gmail.com wrote: On Tue, Jul 28, 2015 at 12:11 AM, Karthik Nayak karthik@gmail.com wrote: Make 'branch.c' use 'ref-filter' APIs for iterating through refs sorting. This removes most of the code used in 'branch.c' replacing it with

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: On Wed, Jul 29, 2015 at 4:00 AM, Junio C Hamano gits...@pobox.com wrote: So doing the absolute minimum, leaving the now what can we do to improve notes-merge process? outside the scope of the topic. That's exactly what I was also trying to do: David's

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
Johan Herland jo...@herland.net writes: I believe it is a bad compromise. It complicates the code, and it provides a concurrent notes merges that is unnecessarily tied to (and dependent on) worktrees. For example, if I wanted to perform N concurrent notes merges in a project that happens to

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Johan Herland
On Wed, Jul 29, 2015 at 4:00 AM, Junio C Hamano gits...@pobox.com wrote: Michael Haggerty mhag...@alum.mit.edu writes: It sounds like what a notes merge really wants is a new linked worktree that has branch refs/notes/foo checked out: * This would allow multiple notes merges to take place at

Re: Fwd: Bug#793884: git: allows nonsensical command 'git checkout -b HEAD'

2015-07-28 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: This seems like a good thing to fix (i.e. make sure XX is not ambiguous before creating it with git checkout -b XX) Yeah, sounds like an easy lunch-time hack low-hanging fruit :-). -- To unsubscribe from this list: send the line unsubscribe git in the body

Re: git branch command is incompatible with bash

2015-07-28 Thread Jeff King
On Tue, Jul 28, 2015 at 08:23:40AM -0700, Junio C Hamano wrote: I can see that symbolic-ref --short is much newer than the other one, so addition of --abbrev-ref to rev-parse may have been a mistake made while being desperate (i.e. not having a way to do so with plumbing, we wanted some way

Re: [RFC/PATCH 03/11] ref-filter: add option to filter only branches

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 7:08 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: +static int filter_branch_kind(struct ref_filter *filter, const char *refname) +{ + int kind, i; + + static struct { + int kind; +

Re: [PATCH 2/6] Documentation/config: mention now and never for 'expire' settings

2015-07-28 Thread Eric Sunshine
[+cc:Paul Tan] On Sun, Jul 26, 2015 at 9:41 PM, Michael Haggerty mhag...@alum.mit.edu wrote: On 07/23/2015 09:00 PM, Eric Sunshine wrote: In addition to approxidate-style values (2.months.ago, yesterday), consumers of 'gc.*expire*' configuration variables also accept and respect 'now'/'all'

Re: Log messages beginning # and git rebase -i

2015-07-28 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: Ed Avis e...@waniasset.com writes: Eric Sunshine sunshine at sunshineco.com writes: the editing for the combined log message treats lines beginning with # as comments. This means that if you are not careful the commit message can get lost on

[PATCH] am: let command-line options override saved options

2015-07-28 Thread Paul Tan
When resuming, git-am ignores command-line options. For instance, when a patch fails to apply with git am patch, subsequently running git am --3way patch would not cause git-am to fall back on attempting a threeway merge. This occurs because by default the --3way option is saved as false, and the

Re: [PATCH 1/5] refs: Introduce pseudoref and per-worktree ref concepts

2015-07-28 Thread Eric Sunshine
On Mon, Jul 27, 2015 at 4:08 PM, David Turner dtur...@twopensource.com wrote: refs: Introduce pseudoref and per-worktree ref concepts Add glossary entries for both concepts. Based upon the above, I thought this was going to be a documentation-only patch and was mildly surprised to find that it

Re: [PATCH] am: let command-line options override saved options

2015-07-28 Thread Junio C Hamano
Paul Tan pyoka...@gmail.com writes: When resuming, git-am ignores command-line options. For instance, when a patch fails to apply with git am patch, subsequently running git am --3way patch would not cause git-am to fall back on attempting a The second one goes without any file argument, i.e.

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 1:24 PM, Jacob Keller jacob.kel...@gmail.com wrote: On Mon, Jul 27, 2015 at 11:56 PM, Karthik Nayak karthik@gmail.com wrote: The 'ifexists' atom allows us to print a required format if the preceeding atom has a value. If the preceeding atom has no value then Don't

Re: [PATCH] am: let command-line options override saved options

2015-07-28 Thread Junio C Hamano
Paul Tan pyoka...@gmail.com writes: diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh new file mode 100755 index 000..c49457c --- /dev/null +++ b/t/t4153-am-resume-override-opts.sh @@ -0,0 +1,144 @@ +#!/bin/sh + +test_description='git-am

Re: git branch command is incompatible with bash

2015-07-28 Thread Johannes Sixt
Am 28.07.2015 um 17:23 schrieb Junio C Hamano: Johannes Sixt j...@kdbg.org writes: Are you trying to say that the result of 'rev-parse --abbrev-ref HEAD' is suboptimal and that of 'symbolic-ref --short HEAD' is OK? My Interesting was primarily about that I wasn't aware of the --abbrev-ref

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Karthik Nayak
On Tue, Jul 28, 2015 at 2:20 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Karthik Nayak karthik@gmail.com writes: --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -149,4 +149,25 @@ test_expect_success 'check `colornext` format option' ' test_cmp

Re: [RFC/PATCH] Port branch.c to use ref-filter APIs

2015-07-28 Thread Matthieu Moy
Karthik Nayak karthik@gmail.com writes: On Tue, Jul 28, 2015 at 7:05 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Ideally, you could also have a modifier atom %(alignleft) [...] This could work for refname, as each ref_array_item holds the refname, But other atoms are only

Re: [RFC/PATCH 04/11] ref-filter: add 'ifexists' atom

2015-07-28 Thread Junio C Hamano
Karthik Nayak karthik@gmail.com writes: The 'ifexists' atom allows us to print a required format if the preceeding atom has a value. If the preceeding atom has no value then the format given is not printed. e.g. to print [refname] we can now use the format %(ifexists:[%s])%(refname). A

[PATCH v3 6/6] sequencer: replace write_cherry_pick_head with update_ref

2015-07-28 Thread David Turner
Now update_ref (via write_pseudoref) does almost exactly what write_cherry_pick_head did, so we can remove write_cherry_pick_head and just use update_ref. Signed-off-by: David Turner dtur...@twopensource.com --- sequencer.c | 23 --- 1 file changed, 4 insertions(+), 19

[PATCH] typofix for index-format.txt

2015-07-28 Thread Thomas Ackermann
Signed-off-by: Thomas Ackermann th.ac...@arcor.de --- Documentation/technical/index-format.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt index b7093af..7392ff6 100644 ---

Re: [PATCH v3 0/6] pseudorefs

2015-07-28 Thread Junio C Hamano
On top of what work is this series expected to be applied? -- 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 v3 0/6] pseudorefs

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 12:01 -0700, Junio C Hamano wrote: On top of what work is this series expected to be applied? I think I started from 'next' as of a few days ago: commit df7aaa5e3454bbcbb1f142dd6b95b214d0b8efad Author: Zoë Blade z...@bytenoise.co.uk Date: Tue Jul 21 14:22:46 2015 +0100

Re: Log messages beginning # and git rebase -i

2015-07-28 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: Matthieu Moy matthieu@grenoble-inp.fr writes: Actually, is there any reason why we do not allow a simple escaping like \# this is a line starting with # \\ this is a line starting with \ # this is a comment What are we trying to achieve? What

Re: [PATCH 4/5] rebase: use update_ref

2015-07-28 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner dtur...@twopensource.com --- bisect.c | 37

Re: [PATCH 2/6] Documentation/config: mention now and never for 'expire' settings

2015-07-28 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: I was just getting ready to re-roll this series[1] to address Michael's comments[2] and noticed that the add-on patch 7/6 which I sent later[3] seems to have been botched when Junio applied it to 'pu'. It's currently at 36598db

[PATCH v3 4/6] pseudorefs: create and use pseudoref update and delete functions

2015-07-28 Thread David Turner
Pseudorefs should not be updated through the ref transaction API, because alternate ref backends still need to store pseudorefs in GIT_DIR (instead of wherever they store refs). Instead, change update_ref and delete_ref to call pseudoref-specific functions. Signed-off-by: David Turner

[PATCH v3 5/6] rebase: use update_ref

2015-07-28 Thread David Turner
Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner dtur...@twopensource.com --- bisect.c | 37 - 1 file changed, 8

[PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread David Turner
All-caps files like NOTES_MERGE_REF are pseudorefs, and thus are per-worktree. We don't want multiple notes merges happening at once (in different worktrees), so we want to make these refs true refs. So, we lowercase NOTES_MERGE_REF and friends. That way, backends that distinguish between

[PATCH v3 1/6] refs: Introduce pseudoref and per-worktree ref concepts

2015-07-28 Thread David Turner
Add glossary entries for both concepts. Pseudorefs and per-worktree refs do not yet have special handling, because the files refs backend already handles them correctly. Later, we will make the LMDB backend call out to the files backend to handle per-worktree refs. Signed-off-by: David Turner

[PATCH v3 0/6] pseudorefs

2015-07-28 Thread David Turner
This version fixes documentation issues found by Eric Sunshine. It also adds a new patch so as not to create static functions that aren't immediately used; Eric also noticed that issue. I refactored the functions to classify a ref into a single public ref_type function. This makes it easy for

Re: Log messages beginning # and git rebase -i

2015-07-28 Thread Junio C Hamano
Matthieu Moy matthieu@grenoble-inp.fr writes: A simple escaping scheme like the above can solve both points: 1) If I want to talk about #include in my commit message, I can spell it \#include and Git would remove the \. The same way, if I want to tell my shell about a inside a

Re: [PATCH 4/5] rebase: use update_ref

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 11:18 -0700, Junio C Hamano wrote: David Turner dtur...@twopensource.com writes: Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: All-caps files like NOTES_MERGE_REF are pseudorefs, and thus are per-worktree. We don't want multiple notes merges happening at once (in different worktrees), so we want to make these refs true refs. So, we lowercase NOTES_MERGE_REF and friends.

[PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread David Turner
When we unpack trees into an existing index, we discard the old index and replace it with the new, merged index. Ensure that this index has its cache-tree populated. This will make subsequent git status and commit commands faster. Signed-off-by: David Turner dtur...@twopensource.com

Re: [PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: The work done to produce the cache-tree is work that the commit would otherwise have to do. So we're spending extra time in one place to eliminate that work in a different place. Good point. Thanks. -- To unsubscribe from this list: send the

[PATCH 0/2] negative hideRefs for overriding

2015-07-28 Thread Jeff King
At GitHub, we keep some information in a private part of the refs namespace. We use transfer.hideRefs so that users do not see it when fetching or pushing, and that works well. However, sometimes we want to expose part of the hidden namespace (e.g., for an internal fetch or push), and that cannot

  1   2   >