On Sun, Oct 23, 2016 at 08:23:01AM +0700, Duy Nguyen wrote:
> I hit the same problem sometimes, but in my case sometimes I
> accidentally do "git add" after "git add -p" and a configuration in
> "git commit -a" won't help me. I'd prefer we could undo changes in
> index instead. Something like refl
On Sat, Oct 22, 2016 at 4:19 PM, Lukas Fleischer wrote:
> On Thu, 20 Oct 2016 at 19:27:58, Jacob Keller wrote:
>> [...]
>> I still think we're misunderstanding. I want git commit to complain
>> *only* under the following circumstance:
>>
>> I run "git add -p" and put a partial change into the inde
On Sat, Oct 22, 2016 at 2:19 AM, Lukas Fleischer wrote:
> On Thu, 20 Oct 2016 at 19:27:58, Jacob Keller wrote:
>> [...]
>> I still think we're misunderstanding. I want git commit to complain
>> *only* under the following circumstance:
>>
>> I run "git add -p" and put a partial change into the inde
From: Junio C Hamano
This function used to be called with check=NULL to signal it to
collect all attributes in the global check_all_attr[] array.
Because the longer term plan is to allocate check_all_attr[] and
attr_stack data structures per git_attr_check instance (i.e. "check"
here) to make th
Signed-off-by: Stefan Beller
---
contrib/completion/git-completion.bash | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index 21016bf..90eb772 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/com
In our own .gitattributes file we have attributes such as:
*.[ch] whitespace=indent,trail,space
When querying for attributes we want to be able to ask for the exact
value, i.e.
git ls-files :(attr:whitespace=indent,trail,space)
should work, but the commas are used in the attr magic to i
The new switch `--init-default-path` initializes the submodules which are
configured in `submodule.defaultUpdatePath` instead of those given as
command line arguments before updating. In the first implementation this
is made incompatible with further command line arguments as it is
unclear what the
The pathspec mechanism is extended via the new
":(attr:eol=input)pattern/to/match" syntax to filter paths so that it
requires paths to not just match the given pattern but also have the
specified attrs attached for them to be chosen.
Signed-off-by: Stefan Beller
Signed-off-by: Junio C Hamano
---
The new switch passes the pathspec to `git submodule update --init`
which is called after the actual clone is done.
Additionally this configures the submodule.defaultUpdatePath to
be the given pathspec, such that any future invocation of
`git submodule update --init-default-paths` will keep up
wit
From: Junio C Hamano
The remaining callers are all simple "I have N attributes I am
interested in. I'll ask about them with various paths one by one".
After this step, no caller to git_check_attrs() remains. After
removing it, we can extend "struct git_attr_check" struct with data
that can be
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 40 +++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/attr.c b/attr.c
index 673dc7a..0f08ee6 100644
--- a/attr.c
+++ b/attr.c
@@ -30,6 +30,11 @@ sta
From: Junio C Hamano
Since nobody uses the old API, make it file-scope static, and update
the documentation to describe the new API.
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
Documentation/technical/api-gitattributes.txt | 82 ++-
attr.c
From: Junio C Hamano
When 82dce998 (attr: more matching optimizations from .gitignore,
2012-10-15) changed a pointer to a string "*pattern" into an
embedded "struct pattern" in struct match_attr, it forgot to update
the comment that describes the structure.
Signed-off-by: Junio C Hamano
Signed-
From: Junio C Hamano
The callchain that starts from git_check_attrs() down to
collect_some_attrs() used to take an array of git_attr_check_elem
as their parameters. Pass the enclosing git_attr_check instance
instead, so that they will have access to new fields we will add to
the data structure.
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/attr.c b/attr.c
index a7f2c3f..95416d3 100644
--- a/attr.c
+++ b/attr.c
@@ -469,7 +469,7 @@ static void debug_set(const char *what, con
From: Junio C Hamano
One codepath needs to just empty the git_attr_check_elem array in
the git_attr_check structure, without releasing the entire resource.
Introduce a helper to do so and rewrite git_attr_check_clear() using
it.
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
a
From: Junio C Hamano
The collect_some_attrs() function has an ugly hack since
06a604e6 (attr: avoid heavy work when we know the specified attr is
not defined, 2014-12-28) added an optimization that relies on the
fact that the caller knows what attributes it is interested in, so
that we can leave
From: Junio C Hamano
If any error is noticed after the match_attr structure is allocated,
we shouldn't just return NULL from this function.
Add a fail_return label that frees the allocated structure and
returns NULL, and consistently jump there when we want to return
NULL after cleaning up.
Sig
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/attr.c b/attr.c
index 4ae7801..05db667 100644
--- a/attr.c
+++ b/attr.c
@@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int l
The prefix check is not related the check of pathspec magic; also there
is no code that is relevant after we'd break the loop on a match for
"prefix:". So move the check before the loop and shortcircuit the outer
loop.
Signed-off-by: Stefan Beller
Signed-off-by: Junio C Hamano
---
pathspec.c |
From: Junio C Hamano
It holds an interned string, and git_attr_name() is a way to peek
into it. Make sure the involved pointer types are pointer-to-const.
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 2 +-
attr.h | 4 ++--
2 files changed, 3 insertions(+), 3 deleti
Signed-off-by: Stefan Beller
Signed-off-by: Junio C Hamano
---
Documentation/gitattributes.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index 8a061af..5b31797 100644
--- a/Documentation/gitattributes.txt
From: Junio C Hamano
A common pattern to check N attributes for many paths is to
(1) prepare an array A of N git_attr_check_elem items;
(2) call git_attr() to intern the N attribute names and fill A;
(3) repeatedly call git_check_attrs() for path with N and A;
A look-up for these N attribute
From: Junio C Hamano
The double-loop wants to do an early return immediately when one
matching macro is found. Eliminate the extra variable 'a' used for
that purpose and rewrite the "assign the found item to 'a' to make
it non-NULL and force the loop(s) to terminate" with a direct return
from th
From: Junio C Hamano
The traditional API to check attributes is to prepare an N-element
array of "struct git_attr_check" and pass N and the array to the
function "git_check_attr()" as arguments.
In preparation to revamp the API to pass a single structure, in
which these N elements are held, rena
From: Nguyễn Thái Ngọc Duy
Full pattern must be quoted. So 'pat"t"ern attr' will give exactly
'pat"t"ern', not 'pattern'. Also clarify that leading whitespaces are
not part of the pattern and document comment syntax.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
Signed-off-
It's not used outside the attr code, so let's keep it private.
Signed-off-by: Stefan Beller
---
attr.c | 4 ++--
attr.h | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/attr.c b/attr.c
index 0f08ee6..881bdfa 100644
--- a/attr.c
+++ b/attr.c
@@ -892,8 +892,8 @@ void git_attr_
From: Junio C Hamano
Export attr_name_valid() function, and a helper function that
returns the message to be given when a given pair
is not a good name for an attribute.
We could later update the message to exactly spell out what the
rules for a good attribute name are, etc.
Signed-off-by: Jun
From: Junio C Hamano
Often a potential caller has pair that
represents the path it wants to ask attributes for; when
path[pathlen] is not NUL, the caller has to xmemdupz()
only to call git_check_attr().
Add git_check_attr_counted() that takes such a counted
string instead of "const char *path".
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/attr.c b/attr.c
index 05db667..a7f2c3f 100644
--- a/attr.c
+++ b/attr.c
@@ -300,7 +300,7 @@ static struct match_attr *parse_attr_line(c
From: Junio C Hamano
Often a potential caller has pair that
represents the name it wants to create an attribute out of.
When name[namelen] is not NUL, the caller has to xmemdupz()
only to call git_attr().
Add git_attr_counted() that takes such a counted string instead of
"const char *name".
S
From: Junio C Hamano
There are too many repetitious "I have this new attr_stack element;
push it at the top of the stack" sequence. The new helper function
push_stack() gives us a way to express what is going on at these
places, and as a side effect, halves the number of times we mention
the att
Instead of having a global attr stack, attach the stack to each check.
This allows to use the attr in a multithreaded way.
Signed-off-by: Stefan Beller
---
attr.c| 101 +++---
attr.h| 4 ++-
hashmap.h | 2 ++
3 files changed,
From: Junio C Hamano
Throughout this series, we are trying to use "check" to name an
instance of "git_attr_check" structure; let's rename a "check" that
refers to an array whose elements are git_attr_check_elem to avoid
confusion.
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
`prefix_pathspec` is quite a lengthy function and we plan on adding more.
Split it up for better readability. As we want to add code into the
inner loop of the long magic parsing, we also benefit from lower
indentation.
Signed-off-by: Stefan Beller
Signed-off-by: Junio C Hamano
---
pathspec.c |
This revamps the API of the attr subsystem to be thread safe.
Before we had the question and its results in one struct type.
The typical usage of the API was
static struct git_attr_check *check;
if (!check)
check = git_attr_check_initl("text", NULL);
git_check_attr(path, chec
From: Junio C Hamano
This updates the other two ways the attribute check is done via an
array of "struct git_attr_check_elem" elements. These two niches
appear only in "git check-attr".
* The caller does not know offhand what attributes it wants to ask
about and cannot use git_attr_check_in
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
attr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/attr.c b/attr.c
index eec5d7d..45aec1b 100644
--- a/attr.c
+++ b/attr.c
@@ -402,8 +402,8 @@ static struct attr_stack *read_attr_fro
previous discussion:
http://public-inbox.org/git/20161012224109.23410-1-sbel...@google.com
http://public-inbox.org/git/20161011002115.23312-1-sbel...@google.com/
This implements the discarded series':
jc/attr
jc/attr-more
sb/pathspec-label
sb/submodule-default-paths
* I rebase to origin master (n
From: Junio C Hamano
Signed-off-by: Junio C Hamano
Signed-off-by: Stefan Beller
---
commit.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/commit.c b/commit.c
index 856fd4a..41b2fdd 100644
--- a/commit.c
+++ b/commit.c
@@ -415,8 +415,7 @@ int find_commit_subject(const c
Hi,
I regularly experience that beginners have problems unterstanding that
--ours and --theirs are swapped when a conflict occurrs on git stash
apply or stash pop.
>From the HCI perspective this is really counter intuitive.
So, I'd like to propose that on git shash pop/apply theirs and ours
shou
On Sat, Oct 22, 2016 at 12:33 AM, Junio C Hamano wrote:
> Johannes Sixt writes:
>
>>> The logic to construct the relative urls is not smart enough to
>>> detect that the ending /. is referring to the directory itself
>>> but rather treats it like any other relative path, i.e.
>>>
>>> path/to/
Johannes Schindelin writes:
> This patch series marks the '4' in the countdown to speed up rebase -i
> by implementing large parts in C (read: there will be three more patch
> series after that before the full benefit hits git.git: sequencer-i,
> rebase--helper and rebase-i-extra).
> ...
> It wou
Jeff King writes:
> When we are checking the path via path_ok(), we use some
> fixed PATH_MAX buffers. We write into them via snprintf(),
> so there's no possibility of overflow, but it does mean we
> may silently truncate the path, leading to potentially
> confusing errors when the partial path
Jeff King writes:
> On Fri, Oct 21, 2016 at 09:39:45PM -0700, Junio C Hamano wrote:
>
>> And this is the final one.
>>
>> -- >8 --
>> From: Junio C Hamano
>> Date: Fri, 21 Oct 2016 21:33:06 -0700
>> Subject: [PATCH] transport: compute summary-width dynamically
>>
>> Now all that is left to do
Christian Couder writes:
> On Fri, Oct 21, 2016 at 2:18 AM, Junio C Hamano wrote:
>>
>> If I were guiding a topic that introduce this feature from scratch
>> today, I would probably suggest a pattern based approach, e.g. a
>> built-in "[-A-Za-z0-9]+:" [*1*] may be the default prefix that is
>>
Attention,
Be informed that We have concluded to effect your payment (2.1M USD) Two
Million One Hundred Thousand Dollars through Western Union Money Transfer. But
the maximum amount you will be receiving daily starting from tomorrow onward is
5,100.00USD until the funds is completely paid out t
On Fri, Oct 21, 2016 at 2:18 AM, Junio C Hamano wrote:
> Jonathan Tan writes:
>
>> That is true - I think we can take the allowed separators as an
>> argument (meaning that we can have different behavior for file parsing
>> and command line parsing), and since we already have that string, we
>> c
On Fri, Oct 21, 2016 at 12:45 AM, Junio C Hamano wrote:
> Jonathan Tan writes:
>
>> If we do that, there is also the necessity of creating a string that
>> combines the separators and '=' (I guess '\n' is not necessary now,
>> since all the lines are null terminated). I'm OK either way.
>>
>> (We
On Thu, 20 Oct 2016 at 19:27:58, Jacob Keller wrote:
> [...]
> I still think we're misunderstanding. I want git commit to complain
> *only* under the following circumstance:
>
> I run "git add -p" and put a partial change into the index in .
> There are still other parts which were not added to th
Johannes Sixt writes:
>> The logic to construct the relative urls is not smart enough to
>> detect that the ending /. is referring to the directory itself
>> but rather treats it like any other relative path, i.e.
>>
>> path/to/dir/. + ../relative/path/to/submodule
>>
>> would result in
>>
>>
Am 22.10.2016 um 01:59 schrieb Stefan Beller:
When adding a submodule via "git submodule add ",
the relative url applies to the superprojects remote. When the
superproject was cloned via "git clone . super", the remote url
is ending with '/.'.
The logic to construct the relative urls is not smar
52 matches
Mail list logo