git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
To: git@vger.kernel.org
Subject: [RFC PATCH 0/6] Add gentle alternative for `get_oid()`
Date: Tue, 17 Jul 2018 15:06:30 +0300	[thread overview]
Message-ID: <cover.1531778417.git.ungureanupaulsebastian@gmail.com> (raw)

At the moment, `get_oid()` might call `die()` in some cases. To
prevent that from happening, this patches introduces a new flag
called `GET_OID_GENTLY` and a new function `get_oid_gently()`,
which passes the mentioned flag further to `get_oid_with_context()`.

The call graph of `get_oid()` is pretty complex and I hope I covered
all the cases where `exit()` might be called. Although I believe this
series of patches will not introduce any regression and work as
intended, I think that is better to mark it with [RFC].

This patch would be useful for converting `git stash` to C. At the
moment, `git stash` spawns a child process to avoid `get_oid()` to
die. If this series turns out to be good enough to be accepted, do
I need to wait until it gets merged in `master` to use it in the
other project mentioned before?

Thanks,
Paul

Paul-Sebastian Ungureanu (6):
  sha1-name: Add `GET_OID_GENTLY` flag
  tree-walk: Add three new gentle helpers
  refs.c: Teach `read_ref_at()` to accept `GET_OID_GENTLY` flag
  sha1-name: Teach `get_oid_basic()` to be gentle
  sha1-name: Teach `get_oid_with_context[_1]()` to be gentle
  sha1-name: Add gentle alternative for `get_oid()`

 cache.h     |   2 +
 refs.c      |   2 +
 sha1-name.c | 127 +++++++++++++++++++++++++++++++++++++++++-----------
 tree-walk.c | 108 +++++++++++++++++++++++++++++++++++++-------
 tree-walk.h |   3 +-
 5 files changed, 199 insertions(+), 43 deletions(-)

-- 
2.18.0.rc2.184.ga79db55c2.dirty


             reply	other threads:[~2018-07-17 12:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 12:06 Paul-Sebastian Ungureanu [this message]
2018-07-17 12:06 ` [RFC PATCH 1/6] sha1-name: Add `GET_OID_GENTLY` flag Paul-Sebastian Ungureanu
2018-07-17 12:06 ` [RFC PATCH 2/6] tree-walk: Add three new gentle helpers Paul-Sebastian Ungureanu
2018-07-17 18:55   ` Junio C Hamano
2018-07-18 23:11     ` Paul-Sebastian Ungureanu
2018-07-17 12:06 ` [RFC PATCH 3/6] refs.c: Teach `read_ref_at()` to accept `GET_OID_GENTLY` flag Paul-Sebastian Ungureanu
2018-07-17 12:06 ` [RFC PATCH 4/6] sha1-name: Teach `get_oid_basic()` to be gentle Paul-Sebastian Ungureanu
2018-07-17 12:06 ` [RFC PATCH 5/6] sha1-name: Teach `get_oid_with_context[_1]()` " Paul-Sebastian Ungureanu
2018-07-17 19:13   ` Junio C Hamano
2018-07-18 23:14     ` Paul-Sebastian Ungureanu
2018-07-17 12:06 ` [RFC PATCH 6/6] sha1-name: Add gentle alternative for `get_oid()` Paul-Sebastian Ungureanu
2018-07-17 17:45 ` [RFC PATCH 0/6] " Duy Nguyen
2018-07-18 23:03   ` Paul-Sebastian Ungureanu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1531778417.git.ungureanupaulsebastian@gmail.com \
    --to=ungureanupaulsebastian@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).