Convert parse_tree_indirect to take a pointer to struct object_id.
Update all the callers. This transformation was achieved using the
following semantic patch and manual updates to the declaration and
definition. Update builtin/checkout.c manually as well, since it uses a
ternary expression not
This is another caller of parse_tree_indirect.
Signed-off-by: brian m. carlson
---
builtin/ls-files.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index a6c70dbe9..da0ff849f 100644
---
This is needed to convert parse_tree_indirect.
Signed-off-by: brian m. carlson
---
builtin/am.c| 2 +-
builtin/blame.c | 6 +++---
builtin/reset.c | 2 +-
diff-lib.c | 12 ++--
diff.h | 2 +-
5 files changed, 12 insertions(+), 12
Make parse_object, parse_object_or_die, and parse_object_buffer take a
pointer to struct object_id. Remove the temporary variables inserted
earlier, since they are no longer necessary. Transform all of the
callers using the following semantic patch:
@@
expression E1;
@@
- parse_object(E1.hash)
This conversion is required to convert parse_tree_indirect.
Signed-off-by: brian m. carlson
---
sequencer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index dcc56a2b6..adcc0a953 100644
--- a/sequencer.c
+++
This is a prerequisite to convert do_diff_cache, which is required to
convert parse_tree_indirect.
Signed-off-by: brian m. carlson
---
builtin/ls-tree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
Signed-off-by: brian m. carlson
---
sha1_name.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_name.c b/sha1_name.c
index b7e09ac13..72e72ab9a 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -798,7 +798,7 @@ struct object
Convert lookup_blob to take a pointer to struct object_id.
The commit was created with manual changes to blob.c and blob.h, plus
the following semantic patch:
@@
expression E1;
@@
- lookup_blob(E1.hash)
+ lookup_blob()
@@
expression E1;
@@
- lookup_blob(E1->hash)
+ lookup_blob(E1)
Signed-off-by: brian m. carlson
---
builtin/reflog.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 4831116ea..7866a0341 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -55,14 +55,14
Rename one function to reflect that it now uses struct object_id. This
conversion is a prerequisite for converting parse_object.
Note that while the use of a buffer that is exactly forty bytes long
looks questionable, get_oid_hex reads exactly the right number of bytes
and does not require the
Signed-off-by: brian m. carlson
---
tree.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tree.c b/tree.c
index 33fa7ee71..21fd80b80 100644
--- a/tree.c
+++ b/tree.c
@@ -58,7 +58,7 @@ static int read_tree_1(struct tree *tree, struct
fast_forward_to is required for checkout_fast_fowrard, which is required
for parse_tree_indirect.
Signed-off-by: brian m. carlson
---
sequencer.c | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/sequencer.c b/sequencer.c
Signed-off-by: brian m. carlson
---
revision.c | 44 ++--
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/revision.c b/revision.c
index f82c56e1f..80f74bb7b 100644
--- a/revision.c
+++ b/revision.c
@@ -177,23
This is a caller of parse_tree_indirect, which must be converted in
order to convert parse_object.
Signed-off-by: brian m. carlson
---
builtin/read-tree.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/read-tree.c
Converting checkout_fast_forward is required to convert
parse_tree_indirect.
Signed-off-by: brian m. carlson
---
builtin/merge.c | 4 ++--
builtin/pull.c | 4 ++--
cache.h | 4 ++--
merge.c | 8
sequencer.c | 2 +-
5 files changed, 11
Among the converted functions is a caller of parse_object_buffer, which
we will convert later.
Signed-off-by: brian m. carlson
---
ref-filter.c | 20 ++--
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/ref-filter.c b/ref-filter.c
Convert the lookup_tree function to take a pointer to struct object_id.
The commit was created with manual changes to tree.c, tree.h, and
object.c, plus the following semantic patch:
@@
@@
- lookup_tree(EMPTY_TREE_SHA1_BIN)
+ lookup_tree(_tree_oid)
@@
expression E1;
@@
- lookup_tree(E1.hash)
+
Convert lookup_tag to take a pointer to struct object_id.
Signed-off-by: brian m. carlson
---
builtin/describe.c | 6 +++---
builtin/pack-objects.c | 2 +-
builtin/replace.c | 2 +-
log-tree.c | 2 +-
object.c | 2 +-
sha1_name.c
Convert the remaining parse_object callers to struct object_id. Use
named constants for several hard-coded values. In addition, rename
got_sha1 to got_oid to reflect the new argument.
Signed-off-by: brian m. carlson
---
upload-pack.c | 50
Make the verify_pack_callback take a pointer to struct object_id.
Change the pack checksum to use GIT_MAX_RAWSZ, even though it is not
strictly an object ID. Doing so ensures resilience against future hash
size changes, and allows us to remove hard-coded assumptions about how
big the buffer needs
Rename this function and convert it to take a pointer to struct
object_id.
This is a prerequisite for converting get_reference, which is needed to
convert parse_object.
Signed-off-by: brian m. carlson
---
builtin/am.c | 2 +-
builtin/checkout.c | 4 ++--
Convert struct ref_array_item to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:
@@
struct ref_array_item E1;
@@
- E1.objectname
+ E1.objectname.hash
@@
struct ref_array_item *E1;
@@
- E1->objectname
+
Convert many of the internals of the files backend to use struct
object_id. Avoid converting public APIs (except one change to
refs/ref-cache.c) to limit the scope of the changes.
Convert one use of get_sha1_hex to parse_oid_hex, and rely on the fact
that a strbuf will be NUL-terminated and that
Convert struct ref_array_item to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:
@@
struct ref_update E1;
@@
- E1.new_sha1
+ E1.new_oid.hash
@@
struct ref_update *E1;
@@
- E1->new_sha1
+ E1->new_oid.hash
@@
Convert the remaining functions to take pointers to struct object_id
instead of pointers to unsigned char, and update the internals of these
functions as well. Among these functions is a caller of lookup_tag,
which we will convert shortly.
Signed-off-by: brian m. carlson
Convert register_shallow and unregister_shallow to take struct
object_id. register_shallow is a caller of lookup_commit, which we will
convert later. It doesn't make sense for the registration and
unregistration functions to have incompatible interfaces, so convert
them both.
Signed-off-by:
There are a small number of remaining callers of lookup_commit_reference
and lookup_commit_reference_gently that still need to be converted to
struct object_id. Convert these.
Signed-off-by: brian m. carlson
---
notes-merge.c | 26 +-
All but a few callers of lookup_blob have been converted to struct
object_id. Introduce a temporary, which will be removed later, into
parse_object to ease the transition, and convert the remaining callers
so that we can update lookup_blob to take struct object_id *.
Signed-off-by: brian m.
This is a prerequisite to convert to lookup_commit, which we will
convert later.
Signed-off-by: brian m. carlson
---
builtin/verify-commit.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/verify-commit.c
Convert struct pack_idx_entry to use struct object_id by changing the
definition and applying the following semantic patch, plus the standard
object_id transforms:
@@
struct pack_idx_entry E1;
@@
- E1.sha1
+ E1.oid.hash
@@
struct pack_idx_entry *E1;
@@
- E1->sha1
+ E1->oid.hash
Signed-off-by:
This is a caller of lookup_commit_or_die, which we will convert later
on.
Signed-off-by: brian m. carlson
---
revision.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/revision.c b/revision.c
index 2b56c3baf..945367034 100644
---
Convert update_squash_messages and is_index_unchanged to struct
object_id. These are callers of lookup_commit and
lookup_commit_reference, which we want to convert.
Signed-off-by: brian m. carlson
---
sequencer.c | 12 ++--
1 file changed, 6 insertions(+),
Convert lookup_commit, lookup_commit_or_die,
lookup_commit_reference, and lookup_commit_reference_gently to take
struct object_id arguments.
Introduce a temporary in parse_object buffer in order to convert this
function. This is required since in order to convert parse_object and
Convert struct delta_info and struct object_info, as well as the various
functions, to use struct object_id. Convert several hard-coded 20
values to GIT_SHA1_RAWSZ. Among the functions converted is a caller of
lookup_blob, which we will convert shortly.
Signed-off-by: brian m. carlson
Parts of this module call lookup_commit_reference, which we want to
convert. The module is small and mostly self-contained, so convert the
rest of it while we're at it.
Signed-off-by: brian m. carlson
---
builtin/tag.c | 66
Adjust the callback functions to take struct object_id * instead of
unsigned char *, and modify related static functions accordingly.
Introduce a temporary object_id instance into files_reflog_expire and
copy the SHA-1 value passed in. This is necessary because the sha1
parameter can come
Specify some constants in terms of GIT_SHA1_HEXSZ, and convert a
get_sha1_hex into parse_oid_hex to avoid needing to specify additional
constants.
Signed-off-by: brian m. carlson
---
tag.c | 15 +++
1 file changed, 7 insertions(+), 8 deletions(-)
diff
Among the functions converted is a caller of lookup_commit_or_die, which
we will convert later on.
Signed-off-by: brian m. carlson
---
http-push.c | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/http-push.c
Convert the internals of create_notes_comit and commit_notes to use
struct object_id.
Signed-off-by: brian m. carlson
---
notes-utils.c | 18 +-
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/notes-utils.c b/notes-utils.c
index
Convert the bundle code, plus the sole external user of struct
ref_list_entry, to use struct object_id. Include cache.h from within
bundle.h to provide the definition. Convert some of the hash parsing
code to use parse_oid_hex to avoid needing to hard-code constant values.
Signed-off-by: brian
Convert the remaining parts of fast-import.c to use struct object_id.
Convert several instances of get_sha1_hex to parse_oid_hex to avoid
needing to specify constants. Convert other hardcoded values to named
constants. Finally, use the is_empty_tree_oid function instead of a
direct comparison
Convert as many instances of unsigned char [20] as possible. Update the
callers of notes_cache_get and notes_cache_put to use the new interface.
Among the functions updated are callers of
lookup_commit_reference_gently, which we will soon convert.
Signed-off-by: brian m. carlson
This is a caller of lookup_commit_reference, which we will soon convert.
Signed-off-by: brian m. carlson
---
parse-options-cb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/parse-options-cb.c b/parse-options-cb.c
index
Convert all the uses of unsigned char [20] to struct object_id. Also,
convert some hard-coded integers into constants.
name_rev_line accepts a wide variety of free-form input and only
interprets 40-character hex values, passing through everything else.
Consequently, it is not a good candidate
Convert struct tree_entry_ms, struct branch, struct tag, and struct
hash_list to use struct object_id by changing the definition and
applying the following semantic patch, plus the standard object_id
transforms:
@@
struct tree_entry_ms E1;
@@
- E1.sha1
+ E1.oid.hash
@@
struct tree_entry_ms *E1;
Convert the sole instance of unsigned char [20] to struct object_id.
cmd_prune is a caller of parse_object, which we will convert later.
Signed-off-by: brian m. carlson
---
builtin/prune.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
Some of the functions converted are callers of lookup_commit_reference.
However, the changes involved in converting the entire thing are not too
large, so we might as well convert it all.
Signed-off-by: brian m. carlson
---
builtin/rev-parse.c | 56
This is a caller of lookup_commit_reference, which we will convert
later.
Signed-off-by: brian m. carlson
---
merge-recursive.c | 8
submodule.c | 24
submodule.h | 8
3 files changed, 20 insertions(+), 20
This function is a caller of lookup_commit_reference_gently, which we
will convert later.
Signed-off-by: brian m. carlson
---
builtin/blame.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/blame.c b/builtin/blame.c
index
This change is required to convert lookup_commit_reference later.
Signed-off-by: brian m. carlson
---
branch.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/branch.c b/branch.c
index ad5a2299b..1758c9708 100644
--- a/branch.c
Convert the sha1 member of struct cache_tree to struct object_id by
changing the definition and applying the following semantic patch, plus
the standard object_id transforms:
@@
struct cache_tree E1;
@@
- E1.sha1
+ E1.oid.hash
@@
struct cache_tree *E1;
@@
- E1->sha1
+ E1->oid.hash
Fix up one
The semantic patch for standard object_id transforms found two
outstanding places where we could make a transformation automatically.
Apply these changes.
Signed-off-by: brian m. carlson
---
builtin/diff.c | 2 +-
reflog-walk.c | 2 +-
2 files changed, 2
Convert all uses of unsigned char [20] to struct object_id. Switch one
use of get_sha1_hex to parse_oid_hex to avoid the need for a constant.
This change is necessary in order to convert parse_object.
Signed-off-by: brian m. carlson
---
fetch-pack.c | 89
This is the eighth series of patches to convert unsigned char [20] to
struct object_id. This series converts lookup_commit, lookup_blob,
lookup_tree, lookup_tag, and finally parse_object to struct object_id.
A small number of functions have temporaries inserted during the
conversion in order to
Ævar Arnfjörð Bjarmason wrote:
> Thanks a lot for public-inbox, my only problem with it is that it
> doesn't cover every single mailing list I'm on, just git :)
Yes, I'm hoping more folks can start running their own
instances. I notice you're on p5p where I started to
On Sat, May 6, 2017 at 3:50 PM, Eric Wong wrote:
> (I have no idea what Jonathan Tirado wrote; it was encrypted (but
> sent to a public list).
>
> Samuel Lijin wrote:
>> Yep, I see these on public-inbox.org/git/ but not in my gmail inbox:
>
> Hi Samuel, check
On Sat, May 6, 2017 at 10:50 PM, Eric Wong wrote:
> (I have no idea what Jonathan Tirado wrote; it was encrypted (but
> sent to a public list).
>
> Samuel Lijin wrote:
>> Yep, I see these on public-inbox.org/git/ but not in my gmail inbox:
>
> Hi Samuel, check
(I have no idea what Jonathan Tirado wrote; it was encrypted (but
sent to a public list).
Samuel Lijin wrote:
> Yep, I see these on public-inbox.org/git/ but not in my gmail inbox:
Hi Samuel, check your Spam box (and move it to a normal inbox so
they can train it). Gmail
On Sat, May 6, 2017 at 5:30 AM, akos tajti wrote:
> Dear All,
>
> we implemented a java servlet around the git-http-backend. This servlet
> intercepts the requests sent by the git client when pushing. One thing I want
> to achieve is parsing the commit messages in the pre
When we taught read_directory_recursive() to recurse into untracked
directories in search of ignored files given DIR_SHOW_IGNORED_TOO, that
had the side effect of teaching it to collect the untracked contents of
untracked directories. It does not make sense to return these, so we
teach
This was previously broken (and likely never worked); this concludes the
patch series fixing the behavior of clean -d.
Signed-off-by: Samuel Lijin
---
t/t7300-clean.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
We now expect `status --ignored` to list ignored files even if they are
in an untracked directory.
Signed-off-by: Samuel Lijin
---
t/t7061-wtstatus-ignore.sh | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/t/t7061-wtstatus-ignore.sh
There is an implicit assumption that a directory containing only
untracked and ignored files should itself be considered untracked. This
makes sense in use cases where we're asking if a directory should be
added to the git database, but not when we're asking if a directory can
be safely removed
Signed-off-by: Samuel Lijin
---
dir.c | 4 ++--
dir.h | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/dir.c b/dir.c
index fd445ee9e..6a71683df 100644
--- a/dir.c
+++ b/dir.c
@@ -1844,7 +1844,7 @@ static enum path_treatment
Introduce a method that allows us to check if one dir_entry corresponds
to a path which contains the path corresponding to another dir_entry.
Signed-off-by: Samuel Lijin
---
dir.c | 8
1 file changed, 8 insertions(+)
diff --git a/dir.c b/dir.c
index
We consider directories containing only untracked and ignored files to
be themselves untracked, which in the usual case means we don't have to
search these directories. This is problematic when we want to collect
ignored files with DIR_SHOW_IGNORED_TOO, though, so we teach
This changes tests for `status --ignored` from test_expect_success to
test_expect_failure in preparation for a change in its expected behavior
(namely, that ignored files in untracked dirs will be reported).
Signed-off-by: Samuel Lijin
---
t/t7061-wtstatus-ignore.sh | 4 ++--
If git sees a directory which contains only untracked and ignored
files, clean -d should not remove that directory. It was recently
discovered that this is *not* true of git clean -d, and it's possible
that this has never worked correctly; this test and its accompanying
patch series aims to fix
Addresses the issues raised by Stefan and Junio (thanks for your feedback)
about not using C99-style comments and keeping tests working on every commit to
prevent breaking git bisect. (About the latter one: is it necessary to prevent
compiler warnings, in addition to compiler errors? Because if
Yep, I see these on public-inbox.org/git/ but not in my gmail inbox:
- Brandon [RFC 01/14] through [RFC 14/14] convert dir.c to take an
index parameter
- Johanne's Coverity patch series
binnbmf6RUfBU.bin
Description: application/pgp-encrypted
encrypted.asc
Description: Binary data
On Wed, 2017-05-03 at 14:51 +0530, Rashmi Pai wrote:
> I am a corporate user of git. I noticed that when you switch between
> the branches and do a git stash ( I miss spelled it as git stahs). Git
> asked if i meant git stash. and i entered yes. and git printed the
> character y infinite times.
Am 04.05.2017 um 12:59 schrieb Johannes Schindelin:
Hi René,
On Wed, 3 May 2017, René Scharfe wrote:
Am 02.05.2017 um 18:02 schrieb Johannes Schindelin:
Reported via Coverity.
Signed-off-by: Johannes Schindelin
---
wt-status.c | 7 ++-
1 file changed, 6
Am 04.05.2017 um 15:56 schrieb Johannes Schindelin:
This change addresses part of the NEEDSWORK comment above the code,
therefore the comment needs to be adjusted, too.
Discovered via Coverity.
Signed-off-by: Johannes Schindelin
---
builtin/checkout.c | 17
If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched. Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.
Signed-off-by: Rene Scharfe
---
builtin/am.c | 2 +-
1 file changed, 1
On Sat, 2017-05-06 at 12:23 +0200, Lars Schneider wrote:
> Hi,
>
> I am about to write a bash/sh script that helps me to rebase a bunch of
> branches (e.g. select branches based on prefix, conflict resolution/
> rerere support, ...).
>
> I wonder if anyone has such a script already and is
If resolve_refdup() fails it returns NULL and possibly leaves its hash
output parameter untouched. Make sure to use it only if the function
succeeded, in order to avoid accessing uninitialized memory.
Found with t/t2011-checkout-invalid-head.sh --valgrind.
Signed-off-by: Rene Scharfe
Hello,
A new version of Tig has been release with several improvements and bug fixes.
What is Tig?
Tig is an ncurses-based text-mode interface for git. It functions mainly
as a Git repository browser, but can also assist in staging changes for
commit at chunk level and act as a
Dear Friend.
Good day ! after much stress, I decided to offer you the sum of Three
hundred thousand United States Dollars ($300,000.00) for your effort
which you made to assist me claimed my fund from the delivering
security company . I have giving rev father Peter Solomon the amount
contain
Dear All,
we implemented a java servlet around the git-http-backend. This servlet
intercepts the requests sent by the git client when pushing. One thing I want
to achieve is parsing the commit messages in the pre push phase (request param
service==git-receive-pack) and after checking if the
Brandon Williams writes:
> One of the things brought up on the list in the past few days has been
> migrating away from using the index compatibility macros. One of the issues
> brought up in that thread was how simply doing that conversion doesn't
> eliminate the reliance on
Hi,
I am about to write a bash/sh script that helps me to rebase a bunch of
branches (e.g. select branches based on prefix, conflict resolution/
rerere support, ...).
I wonder if anyone has such a script already and is willing to share it.
Thanks,
Lars
Hello,
When translating git (https://github.com/git/git/tree/master/po)
The following strings cannot be translated:
remote: Counting objects: 331, done.
remote: Compressing objects: 100% (213/213), done.
remote: Total 244 (delta 184), reused 34 (delta 29)
27 files changed, 3399
This is a must if you are working with submodules, otherwise every git
checkout requires a git submodule update, and you forget it, and
things break, and you understand, and you go to stack overflow
questions
84 matches
Mail list logo