Re: Is there any way to "interrupt" a rebase?

2018-02-19 Thread Jeff King
On Mon, Feb 19, 2018 at 11:35:25AM -0800, Hilco Wijbenga wrote: > git rebase --onto base-branch HEAD~7 > commit A --> conflicts > ... lots of work ... > commit B --> conflicts > ... lots of work ... > commit C (Git handles conflicts) > commit D (no conflict) > commit E --> conflicts > ... er,

Re: [RFC] Rebasing merges: a jorney to the ultimate solution (Road Clear)

2018-02-19 Thread Igor Djordjevic
Hi Sergey, On 16/02/2018 14:08, Sergey Organov wrote: > > By accepting the challenges raised in recent discussion of advanced > support for history rebasing and editing in Git, I hopefully figured out > a clean and elegant method of rebasing merges that I think is "The Right > Way (TM)" to

Re: Is there any way to "interrupt" a rebase?

2018-02-19 Thread Hilco Wijbenga
On Mon, Feb 19, 2018 at 2:36 PM, brian m. carlson wrote: > On Mon, Feb 19, 2018 at 11:35:25AM -0800, Hilco Wijbenga wrote: >> So a scenario like this: >> >> my-branch : X -> A -> B -> C -> D -> E -> F -> G >> base-branch : X -> Y >> >> git rebase --onto base-branch

Re: Git should preserve modification times at least on request

2018-02-19 Thread Theodore Ts'o
On Mon, Feb 19, 2018 at 11:08:19PM +0100, Peter Backes wrote: > Is thetre some existing code that could be used? I think I read > somewhere that git once did preserve mtimes, but that this code was > removed because of the build tool issues. Perhaps that code could > simply be put back in, and

Re: Fetch-hooks

2018-02-19 Thread Jacob Keller
On Mon, Feb 19, 2018 at 2:50 PM, Leo Gaspard wrote: > On 02/19/2018 10:23 PM, Jeff King wrote: >> [...] >> If you do go this route, please model it after "pre-receive" rather than >> "update". We had "update" originally but found it was too limiting for >> hooks to see only one

Re: Git should preserve modification times at least on request

2018-02-19 Thread Hilco Wijbenga
On Mon, Feb 19, 2018 at 2:37 PM, Randall S. Becker wrote: > On February 19, 2018 4:58 PM Johannes wrote: >> On Mon, 19 Feb 2018, Peter Backes wrote: >> >> > please ensure to CC me if you reply as I am not subscribed to the list. >> > >> >

NEED TOOLS

2018-02-19 Thread sophie_rodrigo
hhh

Re: Fetch-hooks

2018-02-19 Thread Jeff King
On Mon, Feb 19, 2018 at 11:50:37PM +0100, Leo Gaspard wrote: > On 02/19/2018 10:23 PM, Jeff King wrote: > > [...] > > If you do go this route, please model it after "pre-receive" rather than > > "update". We had "update" originally but found it was too limiting for > > hooks to see only one ref

[no subject]

2018-02-19 Thread Alfred Cheuk Yu Chow
Good Day, This is the second time i am sending you this mail. I am Mr. Alfred Cheuk Yu Chow, the Director for Credit & Marketing Chong Hing Bank, Hong Kong, need your alliance in a deal that will be of mutual benefit. Email me personally for more details. Regards.

[PATCH v1 3/3] add -p: optimize line selection for short hunks

2018-02-19 Thread Phillip Wood
From: Phillip Wood If there are fewer than ten changes in a hunk then make spaces optional when selecting individual lines. This means that for short hunks one can just type -357 to stage lines 1, 2, 3, 5 & 7. Signed-off-by: Phillip Wood

[PATCH v1 2/3] add -p: allow line selection to be inverted

2018-02-19 Thread Phillip Wood
From: Phillip Wood If the list of lines to be selected begins with '^' select all the lines except the ones listed. Signed-off-by: Phillip Wood --- git-add--interactive.perl | 15 ++- t/t3701-add-interactive.sh | 2 +- 2

Re: [PATCH v1 0/3] add -p: select individual hunk lines

2018-02-19 Thread Gustavo Leite
2018-02-19 8:36 GMT-03:00 Phillip Wood : > > "When I end up editing hunks it is almost always because I want to > stage a subset of the lines in the hunk. Doing this by editing the > hunk is inconvenient and error prone (especially so if the patch is > going to be

מאת: Joy Kone

2018-02-19 Thread joy kone
מאת: Joy Kone שלחתי לך את האימייל הזה בגלל הצורך לפתוח איתך דיונים. אני לא רוצה שתביני בטעות את ההצעה הזאת בכל היבט ... אם זה בסדר איתך, אני מבקש את שיתוף הפעולה המלא שלך. פניתי אליך על בסיס אמון כדי להתמודד עם ההשקעה במדינה שלך / חברה בשמי כשותף פוטנציאלי. שמי ג'וי קוני. אזרח אבל מתגורר כאן. זה

Re: Why git-revert doesn't invoke the pre-commit and the commit-msg hooks?

2018-02-19 Thread Gustavo Chaves
I asked this question on StackOverflow and got an answer: https://stackoverflow.com/q/48852925/114983 The problem is that git-revert invokes git-commit with the -n flag, explicitly avoiding the pre-commit and the commit-msg hooks. This was originally introduced on commit 9fa4db544e2e, by Junio

Re: GSoC 2018: Git has been accepted as a mentor organization!

2018-02-19 Thread Johannes Schindelin
Hi Christian, On Sun, 18 Feb 2018, Christian Couder wrote: > Just a quick message to let everyone know that Git has been accepted > as a mentor organization for the Google Summer of Code 2018. Nice! > Dscho, I just sent you an invite as a mentor, as I think you said you > are ok to mentor.

Re: [PATCH 0/4] Correct offsets of hunks when one is skipped

2018-02-19 Thread Phillip Wood
On 13/02/18 23:56, brian m. carlson wrote: > On Tue, Feb 13, 2018 at 10:44:04AM +, Phillip Wood wrote: >> From: Phillip Wood >> >> While working on a patch series to stage selected lines from a hunk >> without having to edit it I got worried that subsequent patches

[PATCH v2 2/9] t3701: indent here documents

2018-02-19 Thread Phillip Wood
From: Phillip Wood Indent here documents in line with the current style for tests. Signed-off-by: Phillip Wood --- t/t3701-add-interactive.sh | 174 ++--- 1 file changed, 87 insertions(+), 87

[PATCH v2 4/9] t3701: don't hard code sha1 hash values

2018-02-19 Thread Phillip Wood
From: Phillip Wood Purge the index lines from diffs so we're not hard coding sha1 hash values in the expected output. Signed-off-by: Phillip Wood --- t/t3701-add-interactive.sh | 32 1 file changed, 12

[PATCH v2 9/9] add -p: don't rely on apply's '--recount' option

2018-02-19 Thread Phillip Wood
From: Phillip Wood Now that add -p counts patches properly it should be possible to turn off the '--recount' option when invoking 'git apply' Signed-off-by: Phillip Wood --- Notes: I can't think of a reason why this shouldn't be OK

[PATCH v2 0/9] Correct offsets of hunks when one is skipped

2018-02-19 Thread Phillip Wood
From: Phillip Wood Since v1 I've added some test cleanups for t3701, fixed the counting when splitting and coalescing hunks containing "\ No newline at end of file" lines and added a patch to remove '--recount' from the invocation of 'git apply'. There are minor

[PATCH v2 3/9] t3701: use test_write_lines and write_script

2018-02-19 Thread Phillip Wood
From: Phillip Wood Simplify things slightly by using the above helpers. Signed-off-by: Phillip Wood --- t/t3701-add-interactive.sh | 36 +++- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git

[PATCH v2 8/9] add -p: fix counting when splitting and coalescing

2018-02-19 Thread Phillip Wood
From: Phillip Wood When a file has no trailing new line at the end diff records this by appending "\ No newline at end of file" below the last line of the file. This line should not be counted in the hunk header. Fix the splitting and coalescing code to count files

[PATCH v2 5/9] t3701: add failing test for pathological context lines

2018-02-19 Thread Phillip Wood
From: Phillip Wood When a hunk is skipped by add -i the offsets of subsequent hunks are not adjusted to account for any missing insertions due to the skipped hunk. Most of the time this does not matter as apply uses the context lines to apply the subsequent hunks in

[PATCH v2 1/9] add -i: add function to format hunk header

2018-02-19 Thread Phillip Wood
From: Phillip Wood This code is duplicated in a couple of places so make it into a function as we're going to add some more callers shortly. Signed-off-by: Phillip Wood --- git-add--interactive.perl | 21 +++-- 1 file

[PATCH v2 6/9] add -p: Adjust offsets of subsequent hunks when one is skipped

2018-02-19 Thread Phillip Wood
From: Phillip Wood Since commit 8cbd431082 ("git-add--interactive: replace hunk recounting with apply --recount", 2008-7-2) if a hunk is skipped then we rely on the context lines to apply subsequent hunks in the right place. While this works most of the time it is

Re: Please test Git for Windows' latest snapshot

2018-02-19 Thread Johannes Schindelin
Hi Bryan, On Fri, 16 Feb 2018, Bryan Turner wrote: > On Fri, Feb 16, 2018 at 3:30 PM, Johannes Schindelin > wrote: > > Hi team, > > > > I am unwilling to release Git for Windows v2.16.2 on a Friday night, but I > > have something almost as good. There is a snapshot

[PATCH v2 7/9] add -p: calculate offset delta for edited patches

2018-02-19 Thread Phillip Wood
From: Phillip Wood Recount the number of preimage and postimage lines in a hunk after it has been edited so any change in the number of insertions or deletions can be used to adjust the offsets of subsequent hunks. If an edited hunk is subsequently split then the

[PATCH v1 1/3] add -p: select individual hunk lines

2018-02-19 Thread Phillip Wood
From: Phillip Wood When I end up editing hunks it is almost always because I want to stage a subset of the lines in the hunk. Doing this by editing the hunk is inconvenient and error prone (especially so if the patch is going to be reversed before being applied).

[PATCH v1 0/3] add -p: select individual hunk lines

2018-02-19 Thread Phillip Wood
From: Phillip Wood I need to update the add -i documentation but otherwise I think these patches are OK so I thought I'd try and get some feedback. They build on top of the recount fixes in [1]. The commit message for the first patch describes the motivation: "When I

Re: [PATCH v2 4/9] t3701: don't hard code sha1 hash values

2018-02-19 Thread Eric Sunshine
On Mon, Feb 19, 2018 at 6:29 AM, Phillip Wood wrote: > Purge the index lines from diffs so we're not hard coding sha1 hash > values in the expected output. Perhaps the commit message could provide a bit more explanation about why this is a good idea. For instance,

Re: [PATCH v2 3/9] t3701: use test_write_lines and write_script

2018-02-19 Thread Eric Sunshine
On Mon, Feb 19, 2018 at 6:29 AM, Phillip Wood wrote: > From: Phillip Wood > > Simplify things slightly by using the above helpers. > > Signed-off-by: Phillip Wood > --- > diff --git a/t/t3701-add-interactive.sh

[PATCH v4 07/13] commit-graph: implement --set-latest

2018-02-19 Thread Derrick Stolee
It is possible to have multiple commit graph files in a directory, but only one is important at a time. Use a 'graph-latest' file to point to the important file. Teach git-commit-graph to write 'graph-latest' when given the "--set-latest" option. Using this 'graph-latest' file is more robust than

[PATCH v4 04/13] commit-graph: implement write_commit_graph()

2018-02-19 Thread Derrick Stolee
Teach Git to write a commit graph file by checking all packed objects to see if they are commits, then store the file in the given object directory. Signed-off-by: Derrick Stolee --- Makefile | 1 + commit-graph.c | 370

[PATCH v4 05/13] commit-graph: implement 'git-commit-graph write'

2018-02-19 Thread Derrick Stolee
Teach git-commit-graph to write graph files. Create new test script to verify this command succeeds without failure. Signed-off-by: Derrick Stolee --- Documentation/git-commit-graph.txt | 40 + builtin/commit-graph.c | 43 +-

[PATCH v4 02/13] graph: add commit graph design document

2018-02-19 Thread Derrick Stolee
Add Documentation/technical/commit-graph.txt with details of the planned commit graph feature, including future plans. Signed-off-by: Derrick Stolee --- Documentation/technical/commit-graph.txt | 185 +++ 1 file changed, 185 insertions(+)

Re: [PATCH v2 2/9] t3701: indent here documents

2018-02-19 Thread Eric Sunshine
On Mon, Feb 19, 2018 at 6:29 AM, Phillip Wood wrote: > From: Phillip Wood > > Indent here documents in line with the current style for tests. > > Signed-off-by: Phillip Wood > --- > diff --git

[PATCH v4 08/13] commit-graph: implement --delete-expired

2018-02-19 Thread Derrick Stolee
Teach git-commit-graph to delete the .graph files that are siblings of a newly-written graph file, except for the file referenced by 'graph-latest' at the beginning of the process and the newly-written file. If we fail to delete a graph file, only report a warning because another git process may

[PATCH v4 06/13] commit-graph: implement git commit-graph read

2018-02-19 Thread Derrick Stolee
Teach git-commit-graph to read commit graph files and summarize their contents. Use the read subcommand to verify the contents of a commit graph file in the tests. Signed-off-by: Derrick Stolee --- Documentation/git-commit-graph.txt | 15 + builtin/commit-graph.c

[PATCH v4 00/13] Serialized Git Commit Graph

2018-02-19 Thread Derrick Stolee
Thanks for all of the feedback. I've learned a lot working on this patch. As discussed [0], this version changes several fundamental structures and operations, including: * Graph files are stored in .git/objects/info * The "graph-head" file is now called "graph-latest" to avoid confusion with

[PATCH v4 03/13] commit-graph: create git-commit-graph builtin

2018-02-19 Thread Derrick Stolee
Teach git the 'commit-graph' builtin that will be used for writing and reading packed graph files. The current implementation is mostly empty, except for an '--object-dir' option. Signed-off-by: Derrick Stolee --- .gitignore | 1 +

[PATCH v4 09/13] commit-graph: add core.commitGraph setting

2018-02-19 Thread Derrick Stolee
The commit graph feature is controlled by the new core.commitGraph config setting. This defaults to 0, so the feature is opt-in. The intention of core.commitGraph is that a user can always stop checking for or parsing commit graph files if core.commitGraph=0. Signed-off-by: Derrick Stolee

[PATCH v4 10/13] commit-graph: close under reachability

2018-02-19 Thread Derrick Stolee
Teach write_commit_graph() to walk all parents from the commits discovered in packfiles. This prevents gaps given by loose objects or previously-missed packfiles. Also automatically add commits from the existing graph file, if it exists. Signed-off-by: Derrick Stolee ---

[PATCH v4 12/13] commit-graph: read only from specific pack-indexes

2018-02-19 Thread Derrick Stolee
Teach git-commit-graph to inspect the objects only in a certain list of pack-indexes within the given pack directory. This allows updating the commit graph iteratively, since we add all commits stored in a previous commit graph. Signed-off-by: Derrick Stolee ---

[PATCH v4 11/13] commit: integrate commit graph with commit parsing

2018-02-19 Thread Derrick Stolee
Teach Git to inspect a commit graph file to supply the contents of a struct commit when calling parse_commit_gently(). This implementation satisfies all post-conditions on the struct commit, including loading parents, the root tree, and the commit date. The only loosely-expected condition is that

[PATCH v4 13/13] commit-graph: build graph from starting commits

2018-02-19 Thread Derrick Stolee
Teach git-commit-graph to read commits from stdin when the --stdin-commits flag is specified. Commits reachable from these commits are added to the graph. This is a much faster way to construct the graph than inspecting all packed objects, but is restricted to known tips. For the Linux

[PATCH v4 01/13] commit-graph: add format document

2018-02-19 Thread Derrick Stolee
Add document specifying the binary format for commit graphs. This format allows for: * New versions. * New hash functions and hash lengths. * Optional extensions. Basic header information is followed by a binary table of contents into "chunks" that include: * An ordered list of commit object

Re: [PATCH] t/known-leaky: add list of known-leaky test scripts

2018-02-19 Thread Jeff King
On Wed, Feb 14, 2018 at 10:56:37PM +0100, Martin Ågren wrote: > Here's what a list of known leaks might look like. It feels a bit > awkward to post a known-incomplete list (I don't run all tests). Duy > offered to pick up the ball if I gave up, maybe you could complete and > post this as your

Re: cherry-pick '-m' curiosity

2018-02-19 Thread G. Sylvie Davies
On Mon, Feb 5, 2018 at 3:46 AM, Sergey Organov wrote: > Hello, > > $ git help cherry-pick > > -m parent-number, --mainline parent-number >Usually you cannot cherry-pick a merge because you do not >know which side of the merge should be considered the >

Git should preserve modification times at least on request

2018-02-19 Thread Peter Backes
Hello, please ensure to CC me if you reply as I am not subscribed to the list. https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F argues that git isn't preserving modification times because it needs to ensure that build tools work properly.

Re: Git should preserve modification times at least on request

2018-02-19 Thread Johannes Schindelin
Hi Peter, On Mon, 19 Feb 2018, Peter Backes wrote: > please ensure to CC me if you reply as I am not subscribed to the list. > > https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preserving_modification_time_on_files.3F > > argues that git isn't preserving modification times

Re: Git should preserve modification times at least on request

2018-02-19 Thread Peter Backes
Hi Johannes, On Mon, Feb 19, 2018 at 10:58:12PM +0100, Johannes Schindelin wrote: > Since you already assessed that it shouldn't be hard to do, you probably > want to put your money where your mouth is and come up with a patch, and > then offer it up for discussion on this here mailing list.

[GSoC][PATCH] tag: Make "git tag --contains " less chatty if is invalid

2018-02-19 Thread Paul-Sebastian Ungureanu
git tag --contains prints the whole help text if is invalid. It should only show the error message instead. This bug was a side effect of looking up the commit in option parser callback. When a error occurs in the option parser, the full usage is shown. To fix this bug, the part related to

Re: Fetch-hooks

2018-02-19 Thread Jeff King
On Wed, Feb 14, 2018 at 03:02:00AM +0100, Leo Gaspard wrote: > > So does anybody actually want to be able to adjust the refs as they pass > > through? It really sounds like you just want to be able to reject or not > > reject the fetch. And that rejecting would be the uncommon case, so it's > >

Is there any way to "interrupt" a rebase?

2018-02-19 Thread Hilco Wijbenga
Hi all, When maintaining a long running branch, I regularly rebase onto our active development branch so that my branch stays up-to-date. What happens fairly often is that during such a rebase, Git will exit because of rebase/merge conflicts. Nothing unexpected there, of course, but as it

[PATCH 1/2] t5545: factor out http repository setup

2018-02-19 Thread Jeff King
We repeat many lines of setup code in the two http tests, and further tests would need to repeat it again. Let's factor this out into a function. Incidentally, this also fixes an unlikely bug: if the httpd root path contains a double-quote, our test_when_finished would barf due to improper

[PATCH 0/2] quoting bug sending push-options over http

2018-02-19 Thread Jeff King
This series fixes a small quoting problem in 511155db51 (remote-curl: allow push options, 2017-03-22). The interesting one is the second patch. [1/2]: t5545: factor out http repository setup [2/2]: remote-curl: unquote incoming push-options remote-curl.c | 11 ++-

[PATCH 2/2] remote-curl: unquote incoming push-options

2018-02-19 Thread Jeff King
The transport-helper protocol c-style quotes the value of any options passed to the helper via the "option " directive. However, remote-curl doesn't actually unquote the push-option values, meaning that we will send the quoted version to the other side (whereas git-over-ssh would send the raw

Re: Is there any way to "interrupt" a rebase?

2018-02-19 Thread brian m. carlson
On Mon, Feb 19, 2018 at 11:35:25AM -0800, Hilco Wijbenga wrote: > So a scenario like this: > > my-branch : X -> A -> B -> C -> D -> E -> F -> G > base-branch : X -> Y > > git rebase --onto base-branch HEAD~7 > commit A --> conflicts > ... lots of work ... > commit B --> conflicts > ... lots of

RE: Git should preserve modification times at least on request

2018-02-19 Thread Randall S. Becker
On February 19, 2018 4:58 PM Johannes wrote: > On Mon, 19 Feb 2018, Peter Backes wrote: > > > please ensure to CC me if you reply as I am not subscribed to the list. > > > > https://git.wiki.kernel.org/index.php/Git_FAQ#Why_isn.27t_Git_preservi > > ng_modification_time_on_files.3F argues that git

Re: Fetch-hooks

2018-02-19 Thread Leo Gaspard
On 02/19/2018 10:23 PM, Jeff King wrote: > [...] > If you do go this route, please model it after "pre-receive" rather than > "update". We had "update" originally but found it was too limiting for > hooks to see only one ref at a time. So we introduced pre-receive. The > "update" hook remains for

[PATCH 18/36] sha1_file: convert read_loose_object to use struct object_id

2018-02-19 Thread brian m. carlson
Signed-off-by: brian m. carlson --- builtin/fsck.c | 2 +- cache.h| 4 ++-- sha1_file.c| 10 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/builtin/fsck.c b/builtin/fsck.c index 9981db2263..57509a4eac 100644 ---

[PATCH 20/36] streaming: convert open_istream to use struct object_id

2018-02-19 Thread brian m. carlson
Signed-off-by: brian m. carlson --- archive-tar.c | 2 +- archive-zip.c | 2 +- builtin/index-pack.c | 2 +- builtin/pack-objects.c | 2 +- sha1_file.c| 2 +- streaming.c| 6 +++--- streaming.h| 2 +- 7 files

[PATCH 21/36] builtin/mktree: convert to struct object_id

2018-02-19 Thread brian m. carlson
Convert this file to use struct object_id. Modify one use of get_sha1_hex into parse_oid_hex; this is safe since we get the data from a strbuf. Signed-off-by: brian m. carlson --- builtin/mktree.c | 24 1 file changed, 12 insertions(+), 12

[PATCH 02/36] builtin/write-tree: convert to struct object_id

2018-02-19 Thread brian m. carlson
This is needed to convert parts of the cache-tree code. Signed-off-by: brian m. carlson --- builtin/write-tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin/write-tree.c b/builtin/write-tree.c index bd0a78aa3c..299a121531

[PATCH 00/36] object_id part 12

2018-02-19 Thread brian m. carlson
This is the twelfth in a series of patches to convert from unsigned char [20] to struct object_id. This series is based on next. Included in this series are conversions for find_unique_abbrev and lookup_replace_object, as well as parts of the sha1_file code. Conflicts with pu are average in

[PATCH 01/36] bulk-checkin: convert index_bulk_checkin to struct object_id

2018-02-19 Thread brian m. carlson
Convert the index_bulk_checkin function, and the static functions it calls, to use pointers to struct object_id. Signed-off-by: brian m. carlson --- bulk-checkin.c | 18 +- bulk-checkin.h | 2 +- sha1_file.c| 2 +- 3 files changed, 11

[PATCH 03/36] cache-tree: convert write_*_as_tree to object_id

2018-02-19 Thread brian m. carlson
Convert write_index_as_tree and write_cache_as_tree to use struct object_id. Signed-off-by: brian m. carlson --- builtin/am.c | 8 builtin/merge.c | 2 +- builtin/write-tree.c | 2 +- cache-tree.c | 10 +- cache-tree.h

[PATCH 13/36] replace_object: convert struct replace_object to object_id

2018-02-19 Thread brian m. carlson
Convert the two members of this struct to be instances of struct object_id. Adjust the various functions in this file accordingly. Signed-off-by: brian m. carlson --- replace_object.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH 14/36] builtin/mktag: convert to struct object_id

2018-02-19 Thread brian m. carlson
Signed-off-by: brian m. carlson --- builtin/mktag.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/builtin/mktag.c b/builtin/mktag.c index beb552847b..65bb41e3cd 100644 --- a/builtin/mktag.c +++ b/builtin/mktag.c @@ -18,13

[PATCH 07/36] ref-filter: convert grab_objectname to struct object_id

2018-02-19 Thread brian m. carlson
This is necessary in order to convert find_unique_abbrev. Signed-off-by: brian m. carlson --- ref-filter.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index f9e25aea7a..9cbd92611c 100644 ---

[PATCH 29/36] tree-walk: convert get_tree_entry_follow_symlinks internals to object_id

2018-02-19 Thread brian m. carlson
Convert the internals of this function to use struct object_id. This is one of the last remaining callers of read_sha1_file_extended that has not been converted yet. Signed-off-by: brian m. carlson --- tree-walk.c | 22 +++--- 1 file changed, 11

[PATCH 31/36] tree-walk: convert tree entry functions to object_id

2018-02-19 Thread brian m. carlson
Convert get_tree_entry and find_tree_entry to take pointers to struct object_id. Signed-off-by: brian m. carlson --- archive.c | 4 ++-- blame.c| 6 ++ builtin/rm.c | 2 +- builtin/update-index.c | 2 +- line-log.c

[PATCH 24/36] packfile: convert unpack_entry to struct object_id

2018-02-19 Thread brian m. carlson
Convert unpack_entry and read_object to use struct object_id. --- packfile.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packfile.c b/packfile.c index bfa6438b4e..ed7b342ebf 100644 --- a/packfile.c +++ b/packfile.c @@ -1452,7 +1452,7 @@ struct

[PATCH 22/36] sha1_file: convert assert_sha1_type to object_id

2018-02-19 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it to assert_oid_type. Signed-off-by: brian m. carlson --- builtin/commit-tree.c | 2 +- cache.h | 2 +- commit.c | 2 +- sha1_file.c | 8 4 files

[PATCH 33/36] sha1_file: convert read_sha1_file to struct object_id

2018-02-19 Thread brian m. carlson
Convert read_sha1_file to take a pointer to struct object_id and rename it read_object_file. Do the same for read_sha1_file_extended. Convert one use in grep.c to use the new function without any other code change, since the pointer being passed is a void pointer that is already initialized with

[PATCH 30/36] streaming: convert istream internals to struct object_id

2018-02-19 Thread brian m. carlson
Convert the various open_istream variants to take a pointer to struct object_id. Introduce a temporary, which will be removed later, to work around the fact that lookup_replace_object still returns a pointer to unsigned char. Signed-off-by: brian m. carlson ---

[PATCH 35/36] sha1_file: introduce a constant for max header length

2018-02-19 Thread brian m. carlson
There were several instances of 32 sprinkled throughout this file, all of which were used for allocating a buffer to store the header of an object. Introduce a constant, MAX_HEADER_LEN, for this purpose. Note that this constant is slightly larger than required; the longest possible header is 28

[PATCH 25/36] Convert remaining callers of sha1_object_info_extended to object_id

2018-02-19 Thread brian m. carlson
Convert the remaining caller of sha1_object_info_extended to use struct object_id. Introduce temporaries, which will be removed later, since there is a dependency loop between sha1_object_info_extended and lookup_replace_object_extended. This allows us to convert the code in a piecemeal fashion

[PATCH 27/36] builtin/fmt-merge-msg: convert remaining code to object_id

2018-02-19 Thread brian m. carlson
We were using the util pointer, which is a pointer to void, as an unsigned char pointer. The pointer actually points to a struct origin_data, which has a struct object_id as its first member, which in turn has an unsigned char array as its first member, so this was valid. Since we want to convert

[PATCH 26/36] sha1_file: convert sha1_object_info* to object_id

2018-02-19 Thread brian m. carlson
Convert sha1_object_info and sha1_object_info_extended to take pointers to struct object_id and rename them to use "oid" instead of "sha1" in their names. Update the declaration and definition and apply the following semantic patch, plus the standard object_id transforms: @@ expression E1, E2;

[PATCH 23/36] sha1_file: convert retry_bad_packed_offset to struct object_id

2018-02-19 Thread brian m. carlson
Signed-off-by: brian m. carlson --- packfile.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packfile.c b/packfile.c index 5d07f330c8..bfa6438b4e 100644 --- a/packfile.c +++ b/packfile.c @@ -1095,13 +1095,13 @@ static int

[PATCH 34/36] Convert lookup_replace_object to struct object_id

2018-02-19 Thread brian m. carlson
Convert both the argument and the return value to be pointers to struct object_id. Update the callers and their internals to deal with the new type. Remove several temporaries which are no longer needed. Signed-off-by: brian m. carlson --- builtin/mktag.c | 7

[PATCH 36/36] convert: convert to struct object_id

2018-02-19 Thread brian m. carlson
Convert convert.c to struct object_id. Add a use of the_hash_algo to replace hard-coded constants and change a strbuf_add to a strbuf_addstr to avoid another hard-coded constant. Note that a strict conversion using the hexsz constant would cause problems in the future if the internal and

[PATCH 32/36] sha1_file: convert read_object_with_reference to object_id

2018-02-19 Thread brian m. carlson
Convert read_object_with_reference to take pointers to struct object_id. Update the internals of the function accordingly. Signed-off-by: brian m. carlson --- builtin/cat-file.c | 2 +- builtin/grep.c | 4 ++-- builtin/pack-objects.c | 2 +- cache.h

[PATCH 28/36] builtin/notes: convert static functions to object_id

2018-02-19 Thread brian m. carlson
Convert the remaining static functions to take pointers to struct object_id. Signed-off-by: brian m. carlson --- builtin/notes.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index

[PATCH 08/36] strbuf: convert strbuf_add_unique_abbrev to use struct object_id

2018-02-19 Thread brian m. carlson
Convert the declaration and definition of strbuf_add_unique_abbrev to make it take a pointer to struct object_id. Predeclare the struct in strbuf.h, as cache.h includes strbuf.h before it declares the struct, and otherwise the struct declaration would have the wrong scope. Apply the following

[PATCH 04/36] cache-tree: convert remnants to struct object_id

2018-02-19 Thread brian m. carlson
Convert the remaining portions of cache-tree.c to use struct object_id. Convert several instances of 20 to use the_hash_algo instead. Signed-off-by: brian m. carlson --- cache-tree.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-)

[PATCH 10/36] Convert find_unique_abbrev* to struct object_id

2018-02-19 Thread brian m. carlson
Convert find_unique_abbrev and find_unique_abbrev_r to each take a pointer to struct object_id. Signed-off-by: brian m. carlson --- builtin/blame.c| 2 +- builtin/branch.c | 2 +- builtin/checkout.c | 6 +++--- builtin/describe.c | 4 ++--

[PATCH 12/36] send-pack: convert remaining functions to struct object_id

2018-02-19 Thread brian m. carlson
Convert the remaining function, feed_object, to use struct object_id. Signed-off-by: brian m. carlson --- send-pack.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/send-pack.c b/send-pack.c index 8d9190f5e7..19025a7aca 100644 ---

[PATCH 05/36] resolve-undo: convert struct resolve_undo_info to object_id

2018-02-19 Thread brian m. carlson
Convert the sha1 member of this struct to be an array of struct object_id instead. This change is needed to convert find_unique_abbrev. Signed-off-by: brian m. carlson --- builtin/ls-files.c | 2 +- resolve-undo.c | 8 resolve-undo.h | 2 +- 3

[PATCH 16/36] archive: convert sha1_file_to_archive to struct object_id

2018-02-19 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it object_file_to_archive. Signed-off-by: brian m. carlson --- archive-tar.c | 2 +- archive-zip.c | 4 ++-- archive.c | 10 +- archive.h | 8 4 files changed, 12

[PATCH 09/36] wt-status: convert struct wt_status_state to object_id

2018-02-19 Thread brian m. carlson
Convert the various *_sha1 members to use struct object_id instead. Signed-off-by: brian m. carlson --- wt-status.c | 12 ++-- wt-status.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wt-status.c b/wt-status.c index

[PATCH 15/36] archive: convert write_archive_entry_fn_t to object_id

2018-02-19 Thread brian m. carlson
Convert the write_archive_entry_fn_t type to use a pointer to struct object_id. Convert various static functions in the tar and zip archivers also. Signed-off-by: brian m. carlson --- archive-tar.c | 28 ++-- archive-zip.c | 16

[PATCH 06/36] tree: convert read_tree_recursive to struct object_id

2018-02-19 Thread brian m. carlson
Convert the callback functions for read_tree_recursive to take a pointer to struct object_id. Signed-off-by: brian m. carlson --- archive.c | 8 builtin/checkout.c | 4 ++-- builtin/log.c | 2 +- builtin/ls-tree.c | 8

[PATCH 19/36] sha1_file: convert check_sha1_signature to struct object_id

2018-02-19 Thread brian m. carlson
Convert this function to take a pointer to struct object_id and rename it check_object_signature. Introduce temporaries to convert the return values of lookup_replace_object and lookup_replace_object_extended into struct object_id. The temporaries are needed because in order to convert

[PATCH 11/36] http-walker: convert struct object_request to use struct object_id

2018-02-19 Thread brian m. carlson
Convert struct object_request to use struct object_id by updating the definition and applying the following semantic patch, plus the standard object_id transforms: @@ struct object_request E1; @@ - E1.sha1 + E1.oid.hash @@ struct object_request *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by:

[PATCH 17/36] builtin/index-pack: convert struct ref_delta_entry to object_id

2018-02-19 Thread brian m. carlson
Convert this struct to use a member of type object_id. Convert various static functions as well. Signed-off-by: brian m. carlson --- builtin/index-pack.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git